[game-data-packager] 01/01: work around stale package cache

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Aug 29 09:17:42 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 8632ec80ea44441e320ab0d71f5d63b779f30f6c
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Aug 29 11:16:49 2015 +0200

    work around stale package cache
    
    don't recommend to install a game engine that
    has been installed just now
---
 game_data_packager/util.py | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/game_data_packager/util.py b/game_data_packager/util.py
index a63aaae..766ec65 100644
--- a/game_data_packager/util.py
+++ b/game_data_packager/util.py
@@ -84,16 +84,6 @@ class PackageCache:
     available = None
 
     def is_installed(self, package):
-        if self.installed is None:
-            cache = set()
-            proc = subprocess.Popen(['dpkg-query', '--show',
-                        '--showformat', '${Package}\\n'],
-                    universal_newlines=True,
-                    stdout=subprocess.PIPE)
-            for line in proc.stdout:
-                cache.add(line.rstrip())
-            self.installed = cache
-
         # FIXME: this shouldn't be hard-coded
         if package == 'doom-engine':
             return (self.is_installed('chocolate-doom')
@@ -109,6 +99,19 @@ class PackageCache:
             return (self.is_installed('chocolate-hexen')
                  or self.is_installed('doomsday'))
 
+        if os.path.isdir(os.path.join('/usr/share/doc', package)):
+            return True
+
+        if self.installed is None:
+            cache = set()
+            proc = subprocess.Popen(['dpkg-query', '--show',
+                        '--showformat', '${Package}\\n'],
+                    universal_newlines=True,
+                    stdout=subprocess.PIPE)
+            for line in proc.stdout:
+                cache.add(line.rstrip())
+            self.installed = cache
+
         return package in self.installed
 
     def is_available(self, package):

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