[game-data-packager] 01/02: yaml2json: handle disapearing files: stanza too

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sun Oct 4 22:09:54 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 8dad34f92c60240f816c6b085f08ca6904298ca9
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Mon Oct 5 00:08:20 2015 +0200

    yaml2json: handle disapearing files: stanza too
---
 tools/yaml2json.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/yaml2json.py b/tools/yaml2json.py
index 6495c38..8c0d1c0 100755
--- a/tools/yaml2json.py
+++ b/tools/yaml2json.py
@@ -33,10 +33,12 @@ def main(f, out):
                 break
 
     v = data.pop('files', None)
+    offload = os.path.splitext(out)[0] + '.files'
     if v is not None:
-        offload = os.path.splitext(out)[0] + '.files'
         json.dump(v, open(offload + '.tmp', 'w', encoding='utf-8'), sort_keys=True)
         os.rename(offload + '.tmp', offload)
+    elif os.path.isfile(offload):
+        os.remove(offload)
 
     for k in ('cksums', 'sha1sums', 'sha256sums', 'md5sums',
             'size_and_md5'):

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