[jhbuild] sysdeps: Ensure we run pkg-config from the system (/usr/bin)



commit 5a1515299de6966f22c63e1d69ab5023206b8613
Author: Colin Walters <walters verbum org>
Date:   Fri Jul 29 12:43:55 2011 -0400

    sysdeps: Ensure we run pkg-config from the system (/usr/bin)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655553

 jhbuild/config.py              |    3 +++
 jhbuild/moduleset.py           |    2 +-
 jhbuild/utils/systeminstall.py |    7 ++-----
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 4efadc5..40978fb 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -287,6 +287,9 @@ class Config:
                 self.use_local_modulesets = False
             self.modulesets_dir = None
 
+    def get_original_environment(self):
+        return self._orig_environ
+
     def setup_env(self):
         '''set environment variables for using prefix'''
 
diff --git a/jhbuild/moduleset.py b/jhbuild/moduleset.py
index 411ac82..ed7e617 100644
--- a/jhbuild/moduleset.py
+++ b/jhbuild/moduleset.py
@@ -256,7 +256,7 @@ class ModuleSet:
     def get_system_modules(self, modules):
         assert self.config.partial_build
 
-        installed_pkgconfig = systeminstall.get_installed_pkgconfigs()
+        installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
         
         # pkgconfig -> (required_version, installed_verison)
         module_state = {}
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index 5fad0bb..faf5cec 100644
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -26,12 +26,9 @@ from StringIO import StringIO
 
 import cmds
 
-def get_installed_pkgconfigs():
+def get_installed_pkgconfigs(config):
     """Returns a dictionary mapping pkg-config names to their current versions on the system."""
-    env = dict(os.environ)
-    if 'PKG_CONFIG_PATH' in env:
-        del env['PKG_CONFIG_PATH']
-    proc = subprocess.Popen(['pkg-config', '--list-all'], stdout=subprocess.PIPE, env=env, close_fds=True)
+    proc = subprocess.Popen(['pkg-config', '--list-all'], stdout=subprocess.PIPE, env=config.get_original_environment(), close_fds=True)
     stdout = proc.communicate()[0]
     proc.wait()
     pkgs = []



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