summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-04-08 11:34:15 +0000
committerRichard Purdie <richard@openedhand.com>2008-04-08 11:34:15 +0000
commit67d5f0483b66a5688a62dab90395a23dc4bc2772 (patch)
tree642bb9a7f2e5eb27e454a970c5dbf3869623c471
parenta546b63011f5a3db1f393a6f5fb56757c26ce25d (diff)
downloadopenembedded-core-67d5f0483b66a5688a62dab90395a23dc4bc2772.tar.gz
openembedded-core-67d5f0483b66a5688a62dab90395a23dc4bc2772.tar.bz2
openembedded-core-67d5f0483b66a5688a62dab90395a23dc4bc2772.zip
bitbake: Improve fetcher runcmd function so error messages are visable and various variables are exported for the benefit of the git fetcher
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4194 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--bitbake/lib/bb/fetch/__init__.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 4919b9d473..41eebb29b5 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -248,13 +248,22 @@ def runfetchcmd(cmd, d, quiet = False):
Raise an error if interrupted or cmd fails
Optionally echo command output to stdout
"""
- bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd)
# Need to export PATH as binary could be in metadata paths
# rather than host provided
- pathcmd = 'export PATH=%s; %s' % (data.expand('${PATH}', d), cmd)
+ # Also include some other variables.
+ # FIXME: Should really include all export varaiables?
+ exportvars = ['PATH', 'GIT_PROXY_HOST', 'GIT_PROXY_PORT', 'GIT_PROXY_COMMAND']
+
+ for var in exportvars:
+ val = data.getVar(var, d, True)
+ if val:
+ cmd = 'export ' + var + '=%s; %s' % (val, cmd)
+
+ bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd)
- stdout_handle = os.popen(pathcmd, "r")
+ # redirect stderr to stdout
+ stdout_handle = os.popen(cmd + " 2>&1", "r")
output = ""
while 1:
@@ -270,9 +279,9 @@ def runfetchcmd(cmd, d, quiet = False):
exitstatus = status & 0xff
if signal:
- raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (pathcmd, signal, output))
+ raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output))
elif status != 0:
- raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (pathcmd, status, output))
+ raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output))
return output