[game-data-packager] 01/01: add support for cabextract

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Apr 11 07:50: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 3bd04126509479c1b24237af33768815bc915bb7
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Apr 11 09:49:47 2015 +0200

    add support for cabextract
---
 debian/control                 |  4 +++-
 game_data_packager/__init__.py | 11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index edd7975..87df2c3 100644
--- a/debian/control
+++ b/debian/control
@@ -44,7 +44,9 @@ Suggests:
 # for Jedi Academy (demo)
 	unshield,
 # for Descent 1
-        arj,
+	arj,
+# for Arx Fatalis
+	cabextract,
 Architecture: all
 Multi-Arch: foreign
 Description: Installer for game data files
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index ab45e9b..5b9da2a 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -1483,6 +1483,16 @@ class GameData(object):
                         tmp = os.path.join(tmpdir, f)
                         os.utime(tmp, (orig_time, orig_time))
                         self.consider_file(tmp, True)
+                elif fmt == 'cabextract':
+                    to_unpack = provider.unpack.get('unpack', provider.provides)
+                    logger.debug('Extracting %r from %s',
+                            to_unpack, found_name)
+                    tmpdir = os.path.join(self.get_workdir(), 'tmp',
+                            provider_name + '.d')
+                    mkdir_p(tmpdir)
+                    subprocess.check_call(['cabextract', '-q', '-L',
+                                os.path.abspath(found_name)], cwd=tmpdir)
+                    self.consider_file_or_dir(tmpdir)
                 elif fmt == 'innoextract':
                     to_unpack = provider.unpack.get('unpack', provider.provides)
                     logger.debug('Extracting %r from %s',
@@ -1548,6 +1558,7 @@ class GameData(object):
                         # files will instead inherit the archive's timestamp
                         orig_time = os.stat(found_name).st_mtime
                         for f in to_unpack:
+                            logger.debug('Setting timestamp on %s', f)
                             tmp = os.path.join(tmpdir, f)
                             os.utime(tmp, (orig_time, orig_time))
                             self.consider_file(tmp, True)

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