All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake/fetch2: Improve stamp creation in mirror code
@ 2012-05-13 11:43 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-05-13 11:43 UTC (permalink / raw)
  To: bitbake-devel

Under certain conditions 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>

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 8ae8caa..e7571ab 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -476,7 +476,6 @@ 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)
 
@@ -490,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)
@@ -497,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:




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-13 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13 11:43 [PATCH] bitbake/fetch2: Improve stamp creation in mirror code Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.