[game-data-packager] 01/01: Zip files: process 0-byte files too, if still missing use /dev/null

Alexandre Detiste detiste-guest at moszumanska.debian.org
Fri Oct 16 15:41:47 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 139974245bc8862b6c85de49e0d356856d44c9a9
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Fri Oct 16 17:38:50 2015 +0200

    Zip files: process 0-byte files too, if still missing use /dev/null
    
    this way the original timestamp is kept if file is available
    otherwise it is set to 1/1/1970
---
 data/eye-of-the-beholder2.yaml | 4 ----
 game_data_packager/build.py    | 4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/data/eye-of-the-beholder2.yaml b/data/eye-of-the-beholder2.yaml
index 2bd6cc4..306d544 100644
--- a/data/eye-of-the-beholder2.yaml
+++ b/data/eye-of-the-beholder2.yaml
@@ -515,10 +515,6 @@ files:
     - credits.txt?1
     - credits.txt?2
 
-  # workaround bug when processing 0 byte file in zip file
-  playfld.cps?de:
-    look_for: [playfld.cps,/dev/null]
-
   cluebook.pdf:
     look_for: [cluebook.pdf,eobii_cluebook_pdf.pdf]
   manual.pdf:
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 969bd33..ada6f23 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -704,7 +704,7 @@ class PackagingTask(object):
             distinctive_dirs = provider.unpack.get('distinctive_dirs', True)
 
         for entry in zf.infolist():
-            if not entry.file_size:
+            if not entry.file_size and entry.filename.endswith('/'):
                 continue
 
             for filename in try_to_unpack:
@@ -1225,6 +1225,8 @@ class PackagingTask(object):
                     assert (self.file_status[wanted.name] ==
                             FillResult.COMPLETE)
                     return FillResult.COMPLETE
+            elif wanted.size == 0:
+                self.use_file(wanted, '/dev/null')
             elif self.file_status[provider_name] is FillResult.DOWNLOAD_NEEDED:
                 # we don't have it, but we can get it
                 self.file_status[wanted.name] |= FillResult.DOWNLOAD_NEEDED

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