aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-20 12:40:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:10:32 +0100
commit927565c3b1b94b4080ab0678a1c24c39183c4de0 (patch)
treed06c8a1c0db1058affc0703eee48384fa2082155 /bitbake
parent3c8a561a904b917269e0f8b9113469e43de450e4 (diff)
downloadopenembedded-core-contrib-927565c3b1b94b4080ab0678a1c24c39183c4de0.tar.gz
bitbake: fetch2: Ensure when downloading we are consistently in the same directory
This assists with build reproducuility. It also avoids errors if cwd happens not to exist when we call into the fetcher. That situation would be unusual but I hit it with the unit tests. (From Poky rev: 86517af9e066c2da1d580fa66b7c7f0340f3403e) (Bitbake rev: b886c6c15a58643e06ca5ad7a3ff1f7766e4f48c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 2eeec3dd51..b09753f574 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -486,6 +486,8 @@ def try_mirrors(d, origud, mirrors, check = False):
ud = FetchData(newuri, ld)
ud.setup_localpath(ld)
+ os.chdir(ld.getVar("DL_DIR", True))
+
if check:
found = ud.method.checkstatus(newuri, ud, ld)
if found:
@@ -1094,6 +1096,8 @@ class Fetch(object):
if premirroronly:
self.d.setVar("BB_NO_NETWORK", "1")
+ os.chdir(self.d.getVar("DL_DIR", True))
+
firsterr = None
if not localpath and ((not os.path.exists(ud.donestamp)) or m.need_update(u, ud, self.d)):
try:
@@ -1155,7 +1159,7 @@ class Fetch(object):
except:
# Finally, try checking uri, u, from MIRRORS
mirrors = mirror_from_string(self.d.getVar('MIRRORS', True))
- ret = try_mirrors (self.d, ud, mirrors, True)
+ ret = try_mirrors(self.d, ud, mirrors, True)
if not ret:
raise FetchError("URL %s doesn't work" % u, u)