[game-data-packager] 12/21: quake: be approximately command-line compatible with the shell script

Simon McVittie smcv at debian.org
Wed Jan 21 11:52:01 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 9432c4ba9904cce1cddc371b872013ddf21104a5
Author: Simon McVittie <smcv at debian.org>
Date:   Wed Jan 21 09:44:41 2015 +0000

    quake: be approximately command-line compatible with the shell script
---
 data/quake.yaml                       | 20 ++++++++++++++++++++
 lib/game_data_packager/__init__.py    |  5 +++--
 lib/game_data_packager/games/quake.py | 26 ++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/data/quake.yaml b/data/quake.yaml
index 5d14e50..22806b0 100644
--- a/data/quake.yaml
+++ b/data/quake.yaml
@@ -2,6 +2,26 @@
 ---
 longname: Quake
 
+help_text: |
+  For quake-registered, you must provide id1/pak1.pak or a directory
+  containing it, or the mount point for a Quake CD-ROM. The Quake 1.06
+  shareware version will be downloaded if necessary to provide the equivalent
+  of the 1.06 patch, but you can avoid the download by providing version
+  1.06 of id1/pak0.pak
+
+  For quake-shareware, all necessary files can be downloaded automatically.
+
+  For the mission packs quake-armagon and quake-dissolution, you must
+  provide hipnotic/pak0.pak or rogue/pak0.pak or a directory containing it,
+  such as a Quake installation with the mission pack installed or the mount
+  point for one of these mission packs' CD-ROMs.
+
+  For quake-music, quake-armagon and quake-dissolution, either provide
+  a directory containing pre-ripped audio named like id1/music/track02.ogg,
+  hipnotic/music/track02.ogg or rogue/music/track02.ogg, or use syntax
+  like "game-data-packager quake --package=quake-music /dev/cdrom"
+  to rip and encode CD audio tracks.
+
 packages:
   quake-shareware:
     demo_for: quake-registered
diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index b7128a2..3019159 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -1704,12 +1704,13 @@ class GameData(object):
     def get_control_template(self, package):
         return os.path.join(DATADIR, package.name + '.control.in')
 
-    def add_parser(self, parsers, base_parser):
+    def add_parser(self, parsers, base_parser, **kwargs):
         parser = parsers.add_parser(self.shortname,
                 help=self.longname, aliases=self.packages.keys(),
                 description=self.help_text,
                 formatter_class=argparse.RawDescriptionHelpFormatter,
-                parents=(base_parser,))
+                parents=(base_parser,),
+                **kwargs)
         parser.add_argument('paths', nargs='*',
                 metavar='DIRECTORY|FILE',
                 help='Files to use in constructing the .deb')
diff --git a/lib/game_data_packager/games/quake.py b/lib/game_data_packager/games/quake.py
index f168978..85b9383 100644
--- a/lib/game_data_packager/games/quake.py
+++ b/lib/game_data_packager/games/quake.py
@@ -76,4 +76,30 @@ class QuakeGameData(GameData):
                 f.write('#!/bin/sh\nexit 0\n')
             os.chmod(path, 0o755)
 
+    def add_parser(self, parsers, base_parser):
+        parser = super(QuakeGameData, self).add_parser(parsers, base_parser,
+                conflict_handler='resolve')
+        parser.add_argument('-m', '-d', dest='packages', action='append_const',
+                const='quake-registered',
+                help='Equivalent to --package=quake-registered')
+        parser.add_argument('-s', dest='packages', action='append_const',
+                const='quake-shareware',
+                help='Equivalent to --package=quake-shareware')
+        parser.add_argument('--mp1', '-mp1', dest='packages',
+                action='append_const', const='quake-armagon',
+                help='Equivalent to --package=quake-armagon')
+        parser.add_argument('--mp2', '-mp2', dest='packages',
+                action='append_const', const='quake-dissolution',
+                help='Equivalent to --package=quake-dissolution')
+        parser.add_argument('--music', dest='packages',
+                action='append_const', const='quake-music',
+                help='Equivalent to --package=quake-music')
+        parser.add_argument('--mp1-music', dest='packages',
+                action='append_const', const='quake-armagon-music',
+                help='Equivalent to --package=quake-armagon-music')
+        parser.add_argument('--mp2-music', dest='packages',
+                action='append_const', const='quake-dissolution-music',
+                help='Equivalent to --package=quake-dissolution-music')
+        return parser
+
 GAME_DATA_SUBCLASS = QuakeGameData

-- 
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