]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake/fetch2: Correctly handle git mirror tarball fetching
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Feb 2011 12:06:44 +0000 (12:06 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Feb 2011 13:33:29 +0000 (13:33 +0000)
(From Poky rev: 7f30131faaa5e3fdb1191c9da95c5683cefafeb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/__init__.py

index b168fdc3c45d802fb90c03e14dc7495e9cc8e774..2acd148ba3eeb2bbbfca84d63fcad3f8f0cb4e73 100644 (file)
@@ -448,10 +448,11 @@ def try_mirrors(d, origud, mirrors, check = False):
             # We may be obtaining a mirror tarball which needs further processing by the real fetcher
             # If that tarball is a local file:// we need to provide a symlink to it
             dldir = ld.getVar("DL_DIR", True)
-            if not ud.localpath.startswith(dldir):
-                if os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
-                    os.symlink(ud.localpath, os.path.join(dldir, os.path.basename(ud.localpath)))
-                    return None
+            if os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
+                dest = os.path.join(dldir, os.path.basename(ud.localpath))
+                if not os.path.exists(dest):
+                    os.symlink(ud.localpath, dest)
+                return None
             # 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)