[game-data-packager] 01/01: make_template: scummvm packages don't need "install_to:"

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Jun 13 07:04:58 UTC 2015


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 b7512504fa7cf651ea2cf5e1ce5c6ee0b82b561f
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Jun 13 09:04:21 2015 +0200

    make_template: scummvm packages don't need "install_to:"
---
 game_data_packager/make_template.py | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/game_data_packager/make_template.py b/game_data_packager/make_template.py
index 6839fce..27a572a 100644
--- a/game_data_packager/make_template.py
+++ b/game_data_packager/make_template.py
@@ -156,7 +156,6 @@ class GameData(object):
         if steam > 0:
             self.package['steam'] = steam_dict
 
-        self.package['install_to'] = 'usr/share/games/' + game
         has_dosbox = False
 
         for dirpath, dirnames, filenames in os.walk(destdir):
@@ -202,6 +201,9 @@ class GameData(object):
             if has_dosbox:
                 logger.warning('DOSBOX files detected, make sure not to include those in your package')
 
+        if self.plugin != 'scummvm_common':
+            self.package['install_to'] = 'usr/share/games/' + game
+
     def add_one_innoextract(self,exe):
         tmp = tempfile.mkdtemp(prefix='gdptmp.')
         log = subprocess.check_output(['innoextract', os.path.realpath(exe), '-I', 'app'],
@@ -252,7 +254,7 @@ class GameData(object):
 
         self.data = dict(packages={ control['package']: {} })
         self.package = self.data['packages'][control['package']]
-        self.package['install_to'] = None
+        install_to = None
 
         with subprocess.Popen(['dpkg-deb', '--fsys-tarfile', deb],
                 stdout=subprocess.PIPE) as fsys_process:
@@ -280,16 +282,16 @@ class GameData(object):
                         print('')
                         continue
 
-                    if (entry.isfile() and self.package['install_to'] is None):
+                    if (entry.isfile() and install_to is None):
                         # assume this is the place
                         if name.startswith('usr/share/games/'):
                             there = name[len('usr/share/games/'):]
                             there = there.split('/', 1)[0]
-                            self.package['install_to'] = ('usr/share/games/' + there)
+                            install_to = ('usr/share/games/' + there)
                         elif name.startswith('opt/GOG Games/'):
                             there = name[len('opt/GOG Games/'):]
                             there = there.split('/', 1)[0]
-                            self.package['install_to'] = ('opt/GOG Games/' + there)
+                            install_to = ('opt/GOG Games/' + there)
 
                     if entry.isfile():
                         hf = HashedFile.from_file(deb + '//data.tar.*//' + name,
@@ -304,9 +306,9 @@ class GameData(object):
                             name = os.path.basename(name).lower()
                             self.optional.add(name)
                             self.files['files'][name] = dict(install_to='$docdir')
-                        elif (self.package['install_to'] is not None and
-                            name.startswith(self.package['install_to'] + '/')):
-                            name = name[len(self.package['install_to']) + 1:]
+                        elif (install_to is not None and
+                            name.startswith(install_to + '/')):
+                            name = name[len(install_to) + 1:]
                             if lower:
                                 name = name.lower()
                             if self.gog_url and name.startswith('data/'):
@@ -328,6 +330,9 @@ class GameData(object):
                         logger.warning('unhandled data.tar entry type: %s: %s',
                             name, entry.type)
 
+        if self.plugin != 'scummvm_common':
+            self.package['install_to'] = install_to
+
     def to_yaml(self):
         print('---')
         if self.longname:

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