[game-data-packager] 02/51: GameData.to_data: Dump a list of files whose md5, sha1, sha256 are missing

Simon McVittie smcv at debian.org
Fri Dec 29 01:23:34 UTC 2017


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 516fdffc5abd4ca2cda970fbea43849ab3a304a8
Author: Simon McVittie <smcv at debian.org>
Date:   Mon Dec 25 22:29:19 2017 +0000

    GameData.to_data: Dump a list of files whose md5, sha1, sha256 are missing
    
    Signed-off-by: Simon McVittie <smcv at debian.org>
---
 game_data_packager/__init__.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index b3123f8..59e6ca2 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -391,6 +391,32 @@ class GameData(object):
             if v:
                 ret[k] = sort_set_values(v)
 
+        unknown_md5s = set()
+        unknown_sha1s = set()
+        unknown_sha256s = set()
+
+        for filename, f in self.files.items():
+            if f.alternatives:
+                continue
+
+            if f.md5 is None:
+                unknown_md5s.add(filename)
+
+            if f.sha1 is None:
+                unknown_sha1s.add(filename)
+
+            if f.sha256 is None:
+                unknown_sha256s.add(filename)
+
+        if unknown_md5s:
+            ret['unknown_md5s'] = sorted(unknown_md5s)
+
+        if unknown_sha1s:
+            ret['unknown_sha1s'] = sorted(unknown_sha1s)
+
+        if unknown_sha256s:
+            ret['unknown_sha256s'] = sorted(unknown_sha256s)
+
         for k in (
                 'copyright_notice',
                 'help_text',

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