[game-data-packager] 11/25: make_template: prefer official Steam name to basename()

Simon McVittie smcv at debian.org
Wed Feb 11 10:41:12 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 ff5e424c0a26310e038725f9840ff430514a50fd
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Mon Feb 9 18:18:12 2015 +0100

    make_template: prefer official Steam name to basename()
---
 game_data_packager/make_template.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/game_data_packager/make_template.py b/game_data_packager/make_template.py
index c656d36..7b2c4ae 100644
--- a/game_data_packager/make_template.py
+++ b/game_data_packager/make_template.py
@@ -43,11 +43,9 @@ def is_doc(file):
 def do_one_dir(destdir,lower):
     data = dict()
     files = dict(files={})
-    game = os.path.basename(destdir).replace(' ','').lower()
+    game = os.path.basename(destdir)
     if game.endswith('-data'):
         game = game[:len(game) - 5]
-    package = data.setdefault('packages', {}).setdefault(game + '-data', {})
-    package['install_to'] = 'usr/share/games/' + game
 
     steam = max(destdir.find('/SteamApps/common/'),
                 destdir.find('/steamapps/common/'))
@@ -57,11 +55,19 @@ def do_one_dir(destdir,lower):
           for acf in parse_acf(destdir[:steam+11]):
               if '/common/' + acf['installdir'] in destdir:
                    steam_id = acf['appid']
+                   game = acf['name']
                    break
           steam_dict['id'] = steam_id
           steam_dict['path'] = destdir[steam+11:]
+
+    game = game.replace(' ','').replace(':','').replace('-','').lower()
+    package = data.setdefault('packages', {}).setdefault(game + '-data', {})
+
+    if steam > 0:
           package['steam'] = steam_dict
 
+    package['install_to'] = 'usr/share/games/' + game
+
     install = set()
     optional = set()
     sums = dict(sha1={}, md5={}, sha256={}, ck={})

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