summaryrefslogtreecommitdiffstats
path: root/meta/classes/go-vendor.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/go-vendor.bbclass')
-rw-r--r--meta/classes/go-vendor.bbclass12
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass
index 1bbb99ac79..6ec6178add 100644
--- a/meta/classes/go-vendor.bbclass
+++ b/meta/classes/go-vendor.bbclass
@@ -70,7 +70,7 @@ python do_go_vendor() {
70 if os.path.exists(vendor_dir): 70 if os.path.exists(vendor_dir):
71 # Nothing to do except re-establish link to actual vendor folder 71 # Nothing to do except re-establish link to actual vendor folder
72 if not os.path.exists(linkname): 72 if not os.path.exists(linkname):
73 os.symlink(vendor_dir, linkname) 73 oe.path.relsymlink(vendor_dir, linkname)
74 return 74 return
75 75
76 bb.utils.mkdirhier(vendor_dir) 76 bb.utils.mkdirhier(vendor_dir)
@@ -156,7 +156,7 @@ python do_go_vendor() {
156 shutil.copy2(rootdirLicese, subdirLicense) 156 shutil.copy2(rootdirLicese, subdirLicense)
157 157
158 # Copy vendor manifest 158 # Copy vendor manifest
159 modules_txt_src = os.path.join(d.getVar('WORKDIR'), "modules.txt") 159 modules_txt_src = os.path.join(d.getVar('UNPACKDIR'), "modules.txt")
160 bb.debug(1, "cp %s --> %s" % (modules_txt_src, vendor_dir)) 160 bb.debug(1, "cp %s --> %s" % (modules_txt_src, vendor_dir))
161 shutil.copy2(modules_txt_src, vendor_dir) 161 shutil.copy2(modules_txt_src, vendor_dir)
162 162
@@ -201,11 +201,15 @@ python do_go_vendor() {
201 for vendored_name, replaced_path in replaced_paths.items(): 201 for vendored_name, replaced_path in replaced_paths.items():
202 symlink_target = os.path.join(source_dir, *['src', go_import, replaced_path]) 202 symlink_target = os.path.join(source_dir, *['src', go_import, replaced_path])
203 symlink_name = os.path.join(vendor_dir, vendored_name) 203 symlink_name = os.path.join(vendor_dir, vendored_name)
204 relative_symlink_target = os.path.relpath(symlink_target, os.path.dirname(symlink_name))
204 bb.debug(1, "vendored name %s, symlink name %s" % (vendored_name, symlink_name)) 205 bb.debug(1, "vendored name %s, symlink name %s" % (vendored_name, symlink_name))
205 os.symlink(symlink_target, symlink_name) 206
207 os.makedirs(os.path.dirname(symlink_name), exist_ok=True)
208 os.symlink(relative_symlink_target, symlink_name)
206 209
207 # Create a symlink to the actual directory 210 # Create a symlink to the actual directory
208 os.symlink(vendor_dir, linkname) 211 relative_vendor_dir = os.path.relpath(vendor_dir, os.path.dirname(linkname))
212 os.symlink(relative_vendor_dir, linkname)
209} 213}
210 214
211addtask go_vendor before do_patch after do_unpack 215addtask go_vendor before do_patch after do_unpack