Commit 0472048c authored by Pavlo Solntsev's avatar Pavlo Solntsev

get_installed_pkgconfigs: env for subprocess

Use the original environment for getting information about the system
packages. The current code uses jhbuild shell environment,

See GNOME/jhbuild#54
parent ecd10042
Pipeline #143612 passed with stage
in 8 minutes and 3 seconds
......@@ -37,7 +37,7 @@ def get_installed_pkgconfigs(config):
pkgversions = {}
cmd = ['pkg-config', '--list-all']
try:
stdout = subprocess.check_output(cmd, universal_newlines=True)
stdout = subprocess.check_output(cmd, universal_newlines=True, env=config.get_original_environment())
except (subprocess.CalledProcessError, OSError): # pkg-config not installed
logging.error("{} failed".format(cmd))
return pkgversions
......@@ -49,7 +49,8 @@ def get_installed_pkgconfigs(config):
# see if we can get the versions "the easy way"
try:
stdout = subprocess.check_output(['pkg-config', '--modversion'] + pkgs, universal_newlines=True)
stdout = subprocess.check_output(['pkg-config', '--modversion'] + pkgs,
universal_newlines=True, env=config.get_original_environment())
except (subprocess.CalledProcessError, OSError):
pass
else:
......@@ -63,7 +64,7 @@ def get_installed_pkgconfigs(config):
for pkg in pkgs:
cmd = ['pkg-config', '--modversion', pkg]
try:
stdout = subprocess.check_output(cmd, universal_newlines=True)
stdout = subprocess.check_output(cmd, universal_newlines=True, env=config.get_original_environment())
except (subprocess.CalledProcessError, OSError):
logging.error("{} failed".format(cmd))
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment