From patchwork Thu Apr 5 17:07:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel] lib/bb/fetch2: don't skip checksums when local mirror enabled Date: Thu, 05 Apr 2012 17:07:18 -0000 From: Paul Eggleton X-Patchwork-Id: 25217 Message-Id: <1333645638-9195-1-git-send-email-paul.eggleton@linux.intel.com> To: bitbake-devel@lists.openembedded.org If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror. Signed-off-by: Paul Eggleton --- lib/bb/fetch2/__init__.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index e5c4b34..414cc2b 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -476,9 +476,10 @@ 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) - open(ud.donestamp, 'w').close() - if hasattr(ud.method,"build_mirror_data"): - ud.method.build_mirror_data(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 not ud.localpath or not os.path.exists(ud.localpath): continue