[game-data-packager] 01/01: fedora: port check_unpacker & log_missing_tools
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Mon Nov 2 09:14:14 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 3a8c99cc4d9b4157741cca16cdda216c9fd561a3
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Mon Nov 2 10:13:17 2015 +0100
fedora: port check_unpacker & log_missing_tools
---
game_data_packager/build.py | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index faac9a1..8f309ed 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -603,7 +603,7 @@ class PackagingTask(object):
or (basename.startswith('gog_') and extension == '.sh')):
with zipfile.ZipFile(path, 'r') as zf:
self.consider_zip(path, zf)
- elif extension.lower() == '.deb':
+ elif extension.lower() == '.deb' and which('dpkg-deb'):
with subprocess.Popen(['dpkg-deb', '--fsys-tarfile', path],
stdout=subprocess.PIPE) as fsys_process:
with tarfile.open(path + '//data.tar.*', mode='r|',
@@ -2479,9 +2479,15 @@ class PackagingTask(object):
fmt = wanted.unpack['format']
# builtins
- if fmt in ('cat', 'dos2unix', 'tar.gz', 'tar.bz2', 'tar.xz', 'deb', 'zip'):
+ if fmt in ('cat', 'dos2unix', 'tar.gz', 'tar.bz2', 'tar.xz', 'zip'):
return True
+ if fmt == 'deb':
+ if FORMAT == 'deb':
+ return True
+ else:
+ fmt = 'dpkg-deb'
+
if which(fmt) is not None:
return True
@@ -2503,12 +2509,23 @@ class PackagingTask(object):
if not self.missing_tools:
return False
- package_map = {
+ if FORMAT == 'deb':
+ command = 'apt-get'
+ package_map = {
'id-shr-extract': 'dynamite',
'lha': 'lhasa',
'7z': 'p7zip-full',
'unrar-nonfree': 'unrar',
- }
+ }
+ elif FORMAT == 'rpm':
+ command = 'dnf'
+ package_map = {
+ 'dpkg-deb': 'dpkg',
+ 'id-shr-extract': 'dynamite',
+ '7z': 'p7zip-plugins',
+ 'unrar-nonfree': 'unrar',
+ }
+
packages = set()
for t in self.missing_tools:
@@ -2517,5 +2534,4 @@ class PackagingTask(object):
packages.add(p)
logger.warning('installing these packages might help:\n' +
- 'apt-get install %s',
- ' '.join(sorted(packages)))
+ '%s install %s', command, ' '.join(sorted(packages)))
--
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