[game-data-packager] 04/24: make most fields of .control files optional
Simon McVittie
smcv at debian.org
Sat Jan 17 23:28:49 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 96c73ad6e9e532b9bd475ce7020cff71ba5e2c1a
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Sat Jan 17 21:18:57 2015 +0100
make most fields of .control files optional
---
data/spear-of-destiny-mission2-data.control.in | 7 -------
lib/game_data_packager/__init__.py | 18 ++++++++++++++++--
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/data/spear-of-destiny-mission2-data.control.in b/data/spear-of-destiny-mission2-data.control.in
index cb80364..8493824 100644
--- a/data/spear-of-destiny-mission2-data.control.in
+++ b/data/spear-of-destiny-mission2-data.control.in
@@ -1,12 +1,5 @@
-Package: spear-of-destiny-mission2-data
-Section: non-free/games
-Priority: optional
-Architecture: all
-Multi-Arch: foreign
Recommends: wolf4sdl
-Installed-Size: 56
Version: VERSION
-Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
Description: Spear of Destiny - Mission 2: Return to Danger
This package contains extra levels for Spear Of Destiny,
the sequel of Wolfenstein 3D and was generated
diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index 3a27549..8ca9b0e 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -1470,12 +1470,26 @@ class GameData(object):
return True
def modify_control_template(self, control, package, destdir):
+ if 'Package' in control:
+ assert control['Package'] in ('PACKAGE', package.name)
+ control['Package'] = package.name
+
size = subprocess.check_output(['du', '-sk', '--exclude=./DEBIAN',
'.'], cwd=destdir).decode('utf-8').split(None, 1)[0]
- assert control['Package'] in ('PACKAGE', package.name)
- control['Package'] = package.name
control['Installed-Size'] = size
+ default_values = {
+ 'Section' : 'non-free/games',
+ 'Priority' : 'optional',
+ 'Architecture' : 'all',
+ 'Maintainer' : 'Debian Games Team <pkg-games-devel at lists.alioth.debian.org>',
+ }
+ for field in default_values:
+ if field not in control:
+ control[field] = default_values[field]
+ if control['Architecture'] == 'all' and 'Multi-Arch' not in control:
+ control['Multi-Arch'] = 'foreign'
+
depends = set()
suggests = set()
if 'Depends' in control:
--
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