[game-data-packager] 01/01: make_template: sort files by type in checksums
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Thu Jun 11 09:34:31 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 0d32668400ab22ab7d13cf10aa683b33468fba81
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Thu Jun 11 11:32:24 2015 +0200
make_template: sort files by type in checksums
---
game_data_packager/make_template.py | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/game_data_packager/make_template.py b/game_data_packager/make_template.py
index 2de6307..b4e8a5f 100644
--- a/game_data_packager/make_template.py
+++ b/game_data_packager/make_template.py
@@ -49,7 +49,7 @@ def is_doc(file):
name, ext = os.path.splitext(file.lower())
if ext not in ('.doc', '.htm', '.html', '.pdf', '.txt', ''):
return False
- for word in ('changes', 'hintbook', 'manual', 'quickstart', 'readme'):
+ for word in ('changes', 'hintbook', 'manual', 'quickstart', 'readme', 'support'):
if word in name:
return True
return False
@@ -90,8 +90,8 @@ class GameData(object):
self.data = dict()
self.install = set()
- self.license = set()
self.optional = set()
+ self.license = set()
self.files = dict(files={})
self.ck = {}
@@ -110,7 +110,9 @@ class GameData(object):
if lower:
out_name = out_name.lower()
- if is_license(name):
+ if out_name.startswith('setup_') and name.endswith('.exe'):
+ pass
+ elif is_license(name):
out_name = os.path.basename(out_name)
self.license.add(out_name)
elif is_doc(name):
@@ -339,15 +341,18 @@ class GameData(object):
if self.files['files']:
yaml.safe_dump(self.files, stream=sys.stdout, default_flow_style=False)
+ print_order = sorted(self.install) + sorted(self.optional) + sorted(self.license)
+ print_order += sorted(set(self.ck.keys()) - set(print_order))
+
print('\ncksums: |')
- for filename, sum_ in sorted(self.ck.items()):
- print(' _ %-9s %s' % (sum_, filename))
+ for filename in print_order:
+ print(' _ %-9s %s' % (self.ck[filename], filename))
print('\nmd5sums: |')
- for filename, sum_ in sorted(self.md5.items()):
- print(' %s %s' % (sum_, filename))
+ for filename in print_order:
+ print(' %s %s' % (self.md5[filename], filename))
print('\nsha1sums: |')
- for filename, sum_ in sorted(self.sha1.items()):
- print(' %s %s' % (sum_, filename))
+ for filename in print_order:
+ print(' %s %s' % (self.sha1[filename], filename))
print('...')
print('')
--
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