[bitbake-devel] [PATCH] bitbake: fetch2: try_mirror_url(): Replace old git with mirror
Ernst Sjöstrand
ernst.sjostrand at verisure.com
Mon Nov 18 12:40:07 UTC 2019
Ping!
fre 2019-08-16 klockan 08:48 +0000 skrev Ernst Sjöstrand:
fre 2019-05-10 klockan 12:30 +0000 skrev Ernst Sjöstrand:
If we're trying to fetch a git, we're in try_mirror_url and
origud.localpath is a directory, that means the original clone is
broken
for some reason but we found a mirror that works.
Remove the original clone and replace it with a symlink, like what
would
hopefully be done on a fresh fetch.
[ Yocto # 13278 ]
Signed-off-by: Ernst Sjöstrand <
<mailto:ernst.sjostrand at verisure.com>
ernst.sjostrand at verisure.com
>
---
bitbake/lib/bb/fetch2/__init__.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/bitbake/lib/bb/fetch2/__init__.py
b/bitbake/lib/bb/fetch2/__init__.py
index 72d6092deb..be1228d6d5 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -33,6 +33,7 @@ if 'git' not in urllib.parse.uses_netloc:
urllib.parse.uses_netloc.append('git')
import operator
import collections
+import shutil
import subprocess
import pickle
import errno
@@ -1015,6 +1016,11 @@ def try_mirror_url(fetch, origud, ud, ld,
check = False):
if hasattr(origud.method, "build_mirror_data"):
origud.method.build_mirror_data(origud, ld)
return origud.localpath
+ if isinstance(ud.method, git.Git) and
os.path.isdir(origud.localpath) and origud.localpath != ud.localpath:
+ logger.warning("Replacing %s with link to %s",
origud.localpath, ud.localpath)
+ # We have an old git clone here which is broken for some
reason,
+ # remove it and replace is with a symlink.
+ shutil.rmtree(origud.localpath)
# Otherwise the result is a local file:// and we symlink to
it
if not os.path.exists(origud.localpath):
if os.path.islink(origud.localpath):
--
2.17.1
Ping. I could write a longer explanation for why you might end up in
this situation in the commit message, though that's available in the
bug report.
Regards
//Ernst
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20191118/48b3b26d/attachment.html>
More information about the bitbake-devel
mailing list