diff options
| -rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 19 |
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): | |||
| 248 | Raise an error if interrupted or cmd fails | 248 | Raise an error if interrupted or cmd fails |
| 249 | Optionally echo command output to stdout | 249 | Optionally echo command output to stdout |
| 250 | """ | 250 | """ |
| 251 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd) | ||
| 252 | 251 | ||
| 253 | # Need to export PATH as binary could be in metadata paths | 252 | # Need to export PATH as binary could be in metadata paths |
| 254 | # rather than host provided | 253 | # rather than host provided |
| 255 | pathcmd = 'export PATH=%s; %s' % (data.expand('${PATH}', d), cmd) | 254 | # Also include some other variables. |
| 255 | # FIXME: Should really include all export varaiables? | ||
| 256 | exportvars = ['PATH', 'GIT_PROXY_HOST', 'GIT_PROXY_PORT', 'GIT_PROXY_COMMAND'] | ||
| 257 | |||
| 258 | for var in exportvars: | ||
| 259 | val = data.getVar(var, d, True) | ||
| 260 | if val: | ||
| 261 | cmd = 'export ' + var + '=%s; %s' % (val, cmd) | ||
| 262 | |||
| 263 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd) | ||
| 256 | 264 | ||
| 257 | stdout_handle = os.popen(pathcmd, "r") | 265 | # redirect stderr to stdout |
| 266 | stdout_handle = os.popen(cmd + " 2>&1", "r") | ||
| 258 | output = "" | 267 | output = "" |
| 259 | 268 | ||
| 260 | while 1: | 269 | while 1: |
| @@ -270,9 +279,9 @@ def runfetchcmd(cmd, d, quiet = False): | |||
| 270 | exitstatus = status & 0xff | 279 | exitstatus = status & 0xff |
| 271 | 280 | ||
| 272 | if signal: | 281 | if signal: |
| 273 | raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (pathcmd, signal, output)) | 282 | raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output)) |
| 274 | elif status != 0: | 283 | elif status != 0: |
| 275 | raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (pathcmd, status, output)) | 284 | raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output)) |
| 276 | 285 | ||
| 277 | return output | 286 | return output |
| 278 | 287 | ||
