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__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 07b7ae41b4..290773072f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1021,7 +1021,8 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
1021 origud.method.build_mirror_data(origud, ld) 1021 origud.method.build_mirror_data(origud, ld)
1022 return origud.localpath 1022 return origud.localpath
1023 # Otherwise the result is a local file:// and we symlink to it 1023 # Otherwise the result is a local file:// and we symlink to it
1024 ensure_symlink(ud.localpath, origud.localpath) 1024 ensure_symlink(ud.localpath, origud.localpath, relative=True)
1025
1025 update_stamp(origud, ld) 1026 update_stamp(origud, ld)
1026 return ud.localpath 1027 return ud.localpath
1027 1028
@@ -1055,7 +1056,7 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
1055 bb.utils.unlockfile(lf) 1056 bb.utils.unlockfile(lf)
1056 1057
1057 1058
1058def ensure_symlink(target, link_name): 1059def ensure_symlink(target, link_name, relative=False):
1059 if not os.path.exists(link_name): 1060 if not os.path.exists(link_name):
1060 if os.path.islink(link_name): 1061 if os.path.islink(link_name):
1061 # Broken symbolic link 1062 # Broken symbolic link
@@ -1066,6 +1067,8 @@ def ensure_symlink(target, link_name):
1066 # same time, in which case we do not want the second task to 1067 # same time, in which case we do not want the second task to
1067 # fail when the link has already been created by the first task. 1068 # fail when the link has already been created by the first task.
1068 try: 1069 try:
1070 if relative is True:
1071 target = os.path.relpath(target, os.path.dirname(link_name))
1069 os.symlink(target, link_name) 1072 os.symlink(target, link_name)
1070 except FileExistsError: 1073 except FileExistsError:
1071 pass 1074 pass