Sfoglia il codice sorgente

fix check for detection of installed packages on Debian

dpkg-query returns an exit code of 1 when a package is not installed,
which causes an error in the build script. Now, the full list of
packages is read and the desired packages are looked up in it which
should fix #1707
Ashish Kulkarni 11 anni fa
parent
commit
b54f3aa700
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      scripts/build.py

+ 3 - 2
scripts/build.py

@@ -399,10 +399,11 @@ def check_running_on_debian():
 
 PACKAGE_NAME = re.compile(r'ii\s+(.+?)\s+.*')
 def install_packages(*names):
-    lines = get_output('dpkg-query', '--list', *names).split('\n')
+    lines = get_output('dpkg-query', '--list').split('\n')
     avail = [PACKAGE_NAME.match(line).group(1) for line in lines if PACKAGE_NAME.match(line)]
+    inst  = [name for name in names if name in avail]
 
-    if len(avail) != len(names):
+    if len(inst) != len(names):
         shell('apt-get update')
         shell('apt-get install --assume-yes %s' % (' '.join(names)))