[game-data-packager] 06/19: add support for packages.x.install_contents_of
Simon McVittie
smcv at debian.org
Tue Jan 13 11:34:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository game-data-packager.
commit 758d1aa366c565bdb16d586cdfc06dba846d2e0b
Author: Simon McVittie <smcv at debian.org>
Date: Tue Jan 13 09:18:37 2015 +0000
add support for packages.x.install_contents_of
---
lib/game_data_packager/__init__.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index 9df36d8..0866d20 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -291,6 +291,10 @@ 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()
+
@property
def install(self):
return self._install
@@ -299,6 +303,13 @@ class GameDataPackage(object):
self._install = 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 type(self):
return self._type
@type.setter
@@ -483,6 +494,14 @@ class GameData(object):
if 'steam' in self.yaml:
self.steam = self.yaml['steam']
+ for package in self.packages.values():
+ for provider in package.install_contents_of:
+ assert provider in self.files, (package.name, provider)
+ for filename in self.files[provider].provides:
+ assert filename in self.files, (package.name, provider,
+ filename)
+ package.install.add(filename)
+
# consistency check
for package in self.packages.values():
# there had better be something it wants to install
@@ -575,6 +594,9 @@ class GameData(object):
if 'install_to' in d:
package.install_to = d['install_to']
+ if 'install_contents_of' in d:
+ package.install_contents_of = d['install_contents_of']
+
if 'steam' in d:
package.steam = d['steam']
--
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