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 a22458afb3d80ec3de93011b061fea2a1358de91 Author: Alexandre Detiste <[email protected]> Date: Sun Mar 15 17:42:40 2015 +0100 abstract out is_installed() for readability more pedantic implementation, but without any actual gain (?): return not bool(subprocess.call(['dpkg-query', '--status', package], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)) --- game_data_packager/__init__.py | 5 +++-- game_data_packager/util.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py index e5946b7..7c1d0ac 100644 --- a/game_data_packager/__init__.py +++ b/game_data_packager/__init__.py @@ -50,6 +50,7 @@ from .util import (MEBIBYTE, mkdir_p, rm_rf, human_size, + is_installed, which) from .version import GAME_PACKAGE_VERSION @@ -2065,7 +2066,7 @@ class GameData(object): if not engine: continue engine = engine.split('|')[0].split('(')[0].strip() - if not os.path.isdir(os.path.join('/usr/share/doc/', engine)): + if not is_installed(engine): engines.add(engine) if engines: print('it is recommended to also install this game engine: %s' % ', '.join(engines)) @@ -2205,7 +2206,7 @@ class GameData(object): if (package.expansion_for and self.packages[package.expansion_for] not in possible - and not os.path.exists('/usr/share/doc/' + package.expansion_for)): + and not is_installed(package.expansion_for)): for fullgame in possible: if fullgame.type == 'full': logger.warning("won't generate '%s' expansion, because " diff --git a/game_data_packager/util.py b/game_data_packager/util.py index 634fe55..a4d8a52 100644 --- a/game_data_packager/util.py +++ b/game_data_packager/util.py @@ -75,3 +75,6 @@ def copy_with_substitutions(from_, to, **kwargs): for k, v in kwargs.items(): line = line.replace(k, v) to.write(line) + +def is_installed(package): + return os.path.isdir(os.path.join('/usr/share/doc', package)) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

