summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-13 07:40:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-20 07:49:50 +0100
commit2592a43e422c06a6f6174ada562e9c8ba25e1ec1 (patch)
tree3200df34867726914e27aece47645fd2b762e89e
parent9ad1cebe2220b41da2141cdb3f0a403abb46d77c (diff)
downloadbitbake-2592a43e422c06a6f6174ada562e9c8ba25e1ec1.tar.gz
bitbake/fetch2: Improve stamp creation in mirror code
Under certain contitions such as local file:// mirrors of all files, bitbake might not check checksums. This is not desirable and we should always check the checksum where possible. This only exception to this is the git mirror tarball case where the checksum is unknown but we need to create the .done stamp for other reasons. This patch preserves thta functionality but in a more specific section of code where this doesn't interfere in normal checksums. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 5d7ef1f01..ba6849e09 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -476,10 +476,8 @@ def try_mirrors(d, origud, mirrors, check = False):
if not os.path.exists(ud.donestamp) or ud.method.need_update(newuri, ud, ld):
ud.method.download(newuri, ud, ld)
- if os.path.exists(ud.localpath):
- open(ud.donestamp, 'w').close()
- if hasattr(ud.method,"build_mirror_data"):
- ud.method.build_mirror_data(newuri, ud, ld)
+ if hasattr(ud.method,"build_mirror_data"):
+ ud.method.build_mirror_data(newuri, ud, ld)
if not ud.localpath or not os.path.exists(ud.localpath):
continue
@@ -491,6 +489,7 @@ def try_mirrors(d, origud, mirrors, check = False):
# If that tarball is a local file:// we need to provide a symlink to it
dldir = ld.getVar("DL_DIR", True)
if os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
+ open(ud.donestamp, 'w').close()
dest = os.path.join(dldir, os.path.basename(ud.localpath))
if not os.path.exists(dest):
os.symlink(ud.localpath, dest)
@@ -498,6 +497,7 @@ def try_mirrors(d, origud, mirrors, check = False):
# Otherwise the result is a local file:// and we symlink to it
if not os.path.exists(origud.localpath):
os.symlink(ud.localpath, origud.localpath)
+ update_stamp(newuri, origud, ld)
return ud.localpath
except bb.fetch2.NetworkAccess: