[jhbuild] Implement sysdeps --install for path systemmodules (GNOME bug 681344)



commit 3e27946ce6c57b35180839a3e745f618daeb90c2
Author: Craig Keogh <cskeogh adam com au>
Date:   Thu Oct 11 08:58:17 2012 +1030

    Implement sysdeps --install for path systemmodules (GNOME bug 681344)
    
    Implement AptSystemInstall

 jhbuild/utils/systeminstall.py |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index 11221e1..f9c2ddc 100755
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -286,14 +286,12 @@ class AptSystemInstall(SystemInstall):
     def __init__(self):
         SystemInstall.__init__(self)
 
-    def _get_package_for(self, pkg_config):
-        pattern = '/%s.pc' % (pkg_config, )
-        proc = subprocess.Popen(['apt-file', 'search', pattern],
+    def _get_package_for(self, filename):
+        proc = subprocess.Popen(['apt-file', 'search', filename],
                                 stdout=subprocess.PIPE, close_fds=True)
         stdout = proc.communicate()[0]
         if proc.returncode != 0:
             return None
-        pkg = None
         for line in StringIO(stdout):
             parts = line.split(':', 1)
             if len(parts) != 2:
@@ -307,16 +305,20 @@ class AptSystemInstall(SystemInstall):
             # otherwise for now, just take the first match
             return name
 
-    def install(self, pkgconfig_ids):
+    def install(self, uninstalled_pkgconfigs, uninstalled_filenames):
         logging.info(_('Using apt-file to search for providers; this may be slow.  Please wait.'))
         native_packages = []
-        for pkgconfig in pkgconfig_ids:
-            native_pkg = self._get_package_for(pkgconfig)
+        pkgconfigs = [(modname, '/%s.pc' % pkg) for modname, pkg in
+                      uninstalled_pkgconfigs]
+        for modname, filename in pkgconfigs + uninstalled_filenames:
+            native_pkg = self._get_package_for(filename)
             if native_pkg:
                 native_packages.append(native_pkg)
             else:
-                logging.info(_('No native package found for %(id)s') % {'id': pkgconfig})
-            
+                logging.info(_('No native package found for %(id)s '
+                               '(%(filename)s)') % {'id'       : modname,
+                                                   'filename' : filename})
+
         if native_packages:
             logging.info(_('Installing: %(pkgs)s') % {'pkgs': ' '.join(native_packages)})
             args = self._root_command_prefix_args + ['apt-get', 'install']



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]