diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 12:37:35 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 12:37:35 +0000 |
commit | 7c19c96919c55d848c594df7ef5cc21ac6a81b8c (patch) | |
tree | afba02d5958ea3c9f4ae86445f9c16f4fff7b4b9 /lib | |
parent | 2bdc6dc6f48e183d40a13272cb401644528b52f0 (diff) | |
download | bitbake-7c19c96919c55d848c594df7ef5cc21ac6a81b8c.tar.gz |
fetch/__init__.py: export more variables to the fetcher commands to allow ssh checkouts and checkouts through proxies to work better. Also allow user and pswd options in urls globally and improve proxy handling when using mirrors (from Poky)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch/__init__.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index ab0865b75..17fab8efd 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -274,7 +274,7 @@ def runfetchcmd(cmd, d, quiet = False): # rather than host provided # Also include some other variables. # FIXME: Should really include all export varaiables? - exportvars = ['PATH', 'GIT_PROXY_HOST', 'GIT_PROXY_PORT', 'GIT_PROXY_COMMAND'] + exportvars = ['PATH', 'GIT_PROXY_HOST', 'GIT_PROXY_PORT', 'GIT_CONFIG', 'http_proxy', 'ftp_proxy', 'SSH_AUTH_SOCK', 'SSH_AGENT_PID'] for var in exportvars: val = data.getVar(var, d, True) @@ -315,6 +315,10 @@ class FetchData(object): (self.type, self.host, self.path, self.user, self.pswd, self.parm) = bb.decodeurl(data.expand(url, d)) self.date = Fetch.getSRCDate(self, d) self.url = url + if not self.user and "user" in self.parm: + self.user = self.parm["user"] + if not self.pswd and "pswd" in self.parm: + self.pswd = self.parm["pswd"] self.setup = False for m in methods: if m.supports(url, self, d): @@ -465,6 +469,12 @@ class Fetch(object): uri = stash + tarfn bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) fetchcmd = fetchcmd.replace("${URI}", uri) + httpproxy = data.getVar("http_proxy", d, True) + ftpproxy = data.getVar("ftp_proxy", d, True) + if httpproxy: + fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd + if ftpproxy: + fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd ret = os.system(fetchcmd) if ret == 0: bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn) |