[game-data-packager] 01/01: mageia: define functions using urpmq & urpmi
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Fri Jan 8 23:15:49 UTC 2016
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 9cf591010768e40cffc79be4dcf6ed313fe83a22
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Sat Jan 9 00:14:21 2016 +0100
mageia: define functions using urpmq & urpmi
---
game_data_packager/packaging/rpm.py | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/game_data_packager/packaging/rpm.py b/game_data_packager/packaging/rpm.py
index cd88f0e..8a1347a 100644
--- a/game_data_packager/packaging/rpm.py
+++ b/game_data_packager/packaging/rpm.py
@@ -64,7 +64,12 @@ class RpmPackaging(PackagingSystem):
run_as_root(['dnf', 'install'] + list(rpms), gain_root)
elif method == 'zypper':
run_as_root(['zypper', 'install'] + list(rpms), gain_root)
- elif method == 'rpm':
+ elif method == 'urpmi':
+ run_as_root(['/usr/sbin/urpmi'] + list(rpms), gain_root)
+ else:
+ if method != 'rpm':
+ logger.warning(('Unknown installation method %r,'
+ ' using rpm instead') % method)
run_as_root(['rpm', '-U'] + list(rpms), gain_root)
@@ -161,6 +166,18 @@ class ZypperPackaging(RpmPackaging):
class UrpmiPackaging(RpmPackaging):
INSTALL_CMD = ['urpmi']
+ def is_available(self, package):
+ return 0 == subprocess.call(['urpmq', package],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL)
+
+ def available_version(self, package):
+ try:
+ line = check_output(['urpmq', '-r', package]).decode('ascii')
+ return line.split('-')[-2]
+ except subprocess.CalledProcessError:
+ return None
+
def get_distro_packaging():
if os.path.isfile('/etc/mageia-release'):
return UrpmiPackaging()
--
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