[game-data-packager] 01/01: let users override $LANGUAGE/$LANG auto-detection with --package

Alexandre Detiste detiste-guest at moszumanska.debian.org
Tue Oct 20 12:30:15 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 ca0468ca45faf14ae155b5e237fef01282e2eecb
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Tue Oct 20 14:29:25 2015 +0200

    let users override $LANGUAGE/$LANG auto-detection with --package
---
 game_data_packager/build.py | 74 +++++++++++++++++++++++----------------------
 1 file changed, 38 insertions(+), 36 deletions(-)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index d86b8b9..71aacca 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -2070,42 +2070,44 @@ class PackagingTask(object):
         if not possible:
             raise NoPackagesPossible()
 
-        # this check is done before the language check to avoid to end up with
-        # simon-the-sorcerer1-fr-data + simon-the-sorcerer1-dos-en-data
-        for package in set(possible):
-            if (package.better_version
-                and self.game.packages[package.better_version] in possible):
-                  logger.info('will not produce "%s" because better version '
-                     '"%s" is also available',
-                     package.name,
-                     package.better_version)
-                  possible.discard(package)
-
-        for package in set(possible):
-            score = max(set(lang_score(l) for l in package.langs))
-            if score == 0:
-                logger.info('will not produce "%s" '
-                            'because "%s" is not in LANGUAGE selection',
-                            package.name, package.lang)
-                possible.discard(package)
-                continue
-            # keep only prefered language for this virtual package
-            virtual = package.debian.get('provides')
-            if virtual:
-                for other_p in possible:
-                    if other_p.name == package.name:
-                        continue
-                    other_virtual = other_p.debian.get('provides')
-                    if other_virtual != virtual:
-                        continue
-                    if score < lang_score(other_p.lang):
-                        logger.info('will not produce "%s" '
-                                    'because "%s" is prefered language',
-                                    package.name, other_p.lang)
-                        possible.discard(package)
-                        break
-        if not possible:
-            raise NoPackagesPossible()
+        # this fancy algorithm will be overiden by '--package' argument
+        if not log_immediately:
+            # this check is done before the language check to avoid to end up with
+            # simon-the-sorcerer1-fr-data + simon-the-sorcerer1-dos-en-data
+            for package in set(possible):
+                if (package.better_version
+                    and self.game.packages[package.better_version] in possible):
+                      logger.info('will not produce "%s" because better version '
+                         '"%s" is also available',
+                         package.name,
+                         package.better_version)
+                      possible.discard(package)
+
+            for package in set(possible):
+                score = max(set(lang_score(l) for l in package.langs))
+                if score == 0:
+                    logger.info('will not produce "%s" '
+                                'because "%s" is not in LANGUAGE selection',
+                                package.name, package.lang)
+                    possible.discard(package)
+                    continue
+                # keep only prefered language for this virtual package
+                virtual = package.debian.get('provides')
+                if virtual:
+                    for other_p in possible:
+                        if other_p.name == package.name:
+                            continue
+                        other_virtual = other_p.debian.get('provides')
+                        if other_virtual != virtual:
+                            continue
+                        if score < lang_score(other_p.lang):
+                            logger.info('will not produce "%s" '
+                                        'because "%s" is prefered language',
+                                        package.name, other_p.lang)
+                            possible.discard(package)
+                            break
+            if not possible:
+                raise NoPackagesPossible()
 
         for package in set(possible):
             if (package.expansion_for

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