[game-data-packager] 01/02: move to PackageCache remaining call to apt-cache
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Sat Oct 31 16:44:16 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 877092fd3000b012053c37cc5cd20f8a27ab9664
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Sat Oct 31 17:41:58 2015 +0100
move to PackageCache remaining call to apt-cache
---
game_data_packager/build.py | 6 +-----
game_data_packager/util.py | 7 +++++++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index f3354d7..a47ab9d 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1782,11 +1782,7 @@ class PackagingTask(object):
if is_installed:
current_ver = PACKAGE_CACHE.current_version(engine)
else:
- current_ver = check_output(['apt-cache',
- 'madison', engine],
- universal_newlines=True)
- current_ver = current_ver.splitlines()[0]
- current_ver = current_ver.split('|')[1].strip()
+ current_ver = PACKAGE_CACHE.available_version(engine)
if current_ver and Version(current_ver) >= Version(ver):
return FillResult.COMPLETE
diff --git a/game_data_packager/util.py b/game_data_packager/util.py
index 2d96c1f..47a439b 100644
--- a/game_data_packager/util.py
+++ b/game_data_packager/util.py
@@ -150,6 +150,13 @@ class PackageCache:
except subprocess.CalledProcessError:
return
+ def available_version(self, package):
+ current_ver = check_output(['apt-cache', 'madison', package],
+ universal_newlines=True)
+ current_ver = current_ver.splitlines()[0]
+ current_ver = current_ver.split('|')[1].strip()
+ return current_ver
+
PACKAGE_CACHE = PackageCache()
def prefered_lang():
--
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