summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 6bd040493e..72d6092deb 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -643,26 +643,25 @@ def verify_donestamp(ud, d, origud=None):
643 if not ud.needdonestamp or (origud and not origud.needdonestamp): 643 if not ud.needdonestamp or (origud and not origud.needdonestamp):
644 return True 644 return True
645 645
646 if not os.path.exists(ud.donestamp): 646 if not os.path.exists(ud.localpath):
647 # local path does not exist
648 if os.path.exists(ud.donestamp):
649 # done stamp exists, but the downloaded file does not; the done stamp
650 # must be incorrect, re-trigger the download
651 bb.utils.remove(ud.donestamp)
647 return False 652 return False
648 653
649 if (not ud.method.supports_checksum(ud) or 654 if (not ud.method.supports_checksum(ud) or
650 (origud and not origud.method.supports_checksum(origud))): 655 (origud and not origud.method.supports_checksum(origud))):
651 # done stamp exists, checksums not supported; assume the local file is 656 # if done stamp exists and checksums not supported; assume the local
652 # current 657 # file is current
653 return True 658 return os.path.exists(ud.donestamp)
654
655 if not os.path.exists(ud.localpath):
656 # done stamp exists, but the downloaded file does not; the done stamp
657 # must be incorrect, re-trigger the download
658 bb.utils.remove(ud.donestamp)
659 return False
660 659
661 precomputed_checksums = {} 660 precomputed_checksums = {}
662 # Only re-use the precomputed checksums if the donestamp is newer than the 661 # Only re-use the precomputed checksums if the donestamp is newer than the
663 # file. Do not rely on the mtime of directories, though. If ud.localpath is 662 # file. Do not rely on the mtime of directories, though. If ud.localpath is
664 # a directory, there will probably not be any checksums anyway. 663 # a directory, there will probably not be any checksums anyway.
665 if (os.path.isdir(ud.localpath) or 664 if os.path.exists(ud.donestamp) and (os.path.isdir(ud.localpath) or
666 os.path.getmtime(ud.localpath) < os.path.getmtime(ud.donestamp)): 665 os.path.getmtime(ud.localpath) < os.path.getmtime(ud.donestamp)):
667 try: 666 try:
668 with open(ud.donestamp, "rb") as cachefile: 667 with open(ud.donestamp, "rb") as cachefile: