[game-data-packager] 02/02: always silence warning if several files have same look_for & same size

Alexandre Detiste detiste-guest at moszumanska.debian.org
Fri Jun 26 11:09:06 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 0c34fc2bf63eeafff426a2e203fb4e3a999949e9
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Fri Jun 26 13:08:12 2015 +0200

    always silence warning if several files have same look_for & same size
    
    may also happen when reading .zip files
---
 game_data_packager/__init__.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index edc5c6b..3d3ad92 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -989,6 +989,18 @@ class GameData(object):
                     progress=(size > QUITE_LARGE))
 
         if not wanted.skip_hash_matching and not hashes.matches(wanted):
+            # always silence warning if several files have same
+            # look_for & same size: e.g. wolf3d, spear, dune2, ...
+            if log:
+                sizes = []
+                for lf in wanted.look_for:
+                    for filename in self.known_filenames[lf]:
+                        size = self.files[filename].size
+                        if size in sizes:
+                            log = False
+                            break
+                        sizes.append(size)
+
             if log:
                 logger.warning('found possible %s\n' +
                     'but its checksums do not match:\n' +

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