summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2015-08-26 09:37:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 23:28:16 +0100
commit24c79bbed361b37f12d3351af13602e3d4386f4c (patch)
tree6ef307592ac80e64ca91f9633aa825dbc9c6b1c9 /lib/bb/fetch2/__init__.py
parent8dce6964d56b36a77fb113f2ad496cc992a5ff36 (diff)
downloadopenembedded-core-contrib-24c79bbed361b37f12d3351af13602e3d4386f4c.tar.gz
bb.fetch: handle checksums consistently for mirrors
If the main fetch method doesn't support checksums, the user will not be defining them in the recipe, so we don't want to check them for premirrors/mirrors either. This ensures that we never error due to missing checksums on a git mirror tarball. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/__init__.py')
-rw-r--r--lib/bb/fetch2/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index ec0c31ae21..e229c30f61 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -628,7 +628,7 @@ def verify_checksum(ud, d, precomputed={}):
}
-def verify_donestamp(ud, d):
+def verify_donestamp(ud, d, origud=None):
"""
Check whether the done stamp file has the right checksums (if the fetch
method supports them). If it doesn't, delete the done stamp and force
@@ -640,7 +640,8 @@ def verify_donestamp(ud, d):
if not os.path.exists(ud.donestamp):
return False
- if not ud.method.supports_checksum(ud):
+ if (not ud.method.supports_checksum(ud) or
+ (origud and not origud.method.supports_checksum(origud))):
# done stamp exists, checksums not supported; assume the local file is
# current
return True
@@ -922,7 +923,7 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
os.chdir(ld.getVar("DL_DIR", True))
- if not verify_donestamp(ud, ld) or ud.method.need_update(ud, ld):
+ if not verify_donestamp(ud, ld, origud) or ud.method.need_update(ud, ld):
ud.method.download(ud, ld)
if hasattr(ud.method,"build_mirror_data"):
ud.method.build_mirror_data(ud, ld)