[game-data-packager] 01/01: remove 'install_contents_of', groups handle this better

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sun Jan 24 11:31:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 3381373165d8aa6ebecfa138691a5af5cfbd3261
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sun Jan 24 12:31:25 2016 +0100

    remove 'install_contents_of', groups handle this better
---
 data/quake2.yaml               |  9 +++++----
 doc/tags.txt                   |  1 -
 game_data_packager/__init__.py | 24 +-----------------------
 game_data_packager/build.py    | 12 ------------
 4 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/data/quake2.yaml b/data/quake2.yaml
index 0cab0cf..67eb5b3 100644
--- a/data/quake2.yaml
+++ b/data/quake2.yaml
@@ -42,10 +42,10 @@ packages:
     gog:
       url: quake_ii_quad_damage
     install_to: usr/share/games/quake2
-    install_contents_of:
-    - q2-3.20-x86-full-ctf.exe
     install:
     - baseq2/pak0.pak
+    - patch data
+    - patch and demo data
     optional:
     - baseq2 videos
     - dm64 maps
@@ -70,8 +70,9 @@ packages:
 
   quake2-demo-data:
     demo_for: quake2-full-data
-    install_contents_of:
-    - q2-314-demo-x86.exe
+    install:
+      - demo data
+      - patch and demo data
     license:
       - demo license
     doc:
diff --git a/doc/tags.txt b/doc/tags.txt
index 4eac6fe..765a127 100644
--- a/doc/tags.txt
+++ b/doc/tags.txt
@@ -77,7 +77,6 @@ packages:
         sha1:
         sha256:
         size:
-    install_contents_of: list
 
 files:
   <file>:
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 2cb73cc..9255528 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -287,10 +287,6 @@ class GameDataPackage(object):
 
         self.version = GAME_PACKAGE_VERSION
 
-        # if not None, install every file provided by the files with
-        # these names
-        self._install_contents_of = set()
-
         # CD audio stuff from YAML
         self.rip_cd = {}
 
@@ -349,13 +345,6 @@ class GameDataPackage(object):
             self._depends = set(value)
 
     @property
-    def install_contents_of(self):
-        return self._install_contents_of
-    @install_contents_of.setter
-    def install_contents_of(self, value):
-        self._install_contents_of = set(value)
-
-    @property
     def optional(self):
         return self._optional
     @optional.setter
@@ -818,7 +807,7 @@ class GameData(object):
 
     def _populate_package(self, package, d):
         for k in ('expansion_for', 'expansion_for_ext', 'longname', 'symlinks', 'install_to',
-                'install_contents_of', 'description', 'depends',
+                'description', 'depends',
                 'rip_cd', 'architecture', 'aliases', 'better_versions', 'langs', 'mutually_exclusive',
                 'copyright', 'engine', 'lang', 'component', 'section', 'disks', 'provides',
                 'steam', 'gog', 'dotemu', 'origin', 'url_misc', 'wiki', 'copyright_notice',
@@ -1151,11 +1140,6 @@ class GameData(object):
             package.install_files = set(self._iter_expand_groups(package.install))
             package.optional_files = set(self._iter_expand_groups(package.optional))
 
-            for provider in package.install_contents_of:
-                for f in self._iter_expand_groups(self.files[provider].provides):
-                    if f not in package.optional_files:
-                        package.install_files.add(f)
-
         # _iter_expand_groups could change the contents of self.files
         for filename, f in list(self.files.items()):
             f.provides_files = set(self._iter_expand_groups(f.provides))
@@ -1197,12 +1181,6 @@ class GameData(object):
 
         # consistency check
         for package in self.packages.values():
-            for provider in package.install_contents_of:
-                assert provider in self.files, (package.name, provider)
-                for f in self.files[provider].provides_files:
-                    assert (f in package.install_files or
-                            f in package.optional_files), (package.name, f.name)
-
             if package.rip_cd:
                 # we only support Ogg Vorbis for now
                 assert package.rip_cd['encoding'] == 'vorbis', package.name
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 1e1f531..d5159a9 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -936,18 +936,6 @@ class PackagingTask(object):
 
         providers = list(self.game.providers.get(wanted.name, ()))
 
-        # if we are installing everything from a downloadable file,
-        # prefer to fill any gaps from that one, not some other
-        # (e.g. don't download the Quake II demo if we're building
-        # a .deb for the full game, just because their files happen to
-        # overlap)
-        for provider_name in package.install_contents_of:
-            if provider_name in providers:
-                logger.debug('preferring "%s" to provide files for %s',
-                        provider_name, package.name)
-                providers = [provider_name] + [p for p in providers if
-                        p != provider_name]
-
         # pick smallest possible provider to download
         # example: this huge archive is a superset of the smaller one
         # 103M /var/www/html/ETQW-client-1.4-1.5-update.x86.run

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list