diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/go-vendor.bbclass | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass index b965428dd1..48f4d1041c 100644 --- a/meta/classes/go-vendor.bbclass +++ b/meta/classes/go-vendor.bbclass | |||
@@ -103,18 +103,17 @@ python do_go_vendor() { | |||
103 | pathMajor = fetcher.ud[url].parm.get('go_pathmajor') | 103 | pathMajor = fetcher.ud[url].parm.get('go_pathmajor') |
104 | pathMajor = None if not pathMajor else pathMajor.strip('/') | 104 | pathMajor = None if not pathMajor else pathMajor.strip('/') |
105 | 105 | ||
106 | if not repo in modules: | 106 | if not (repo, version) in modules: |
107 | modules[repo] = { "version": version, | 107 | modules[(repo, version)] = { |
108 | "repo_path": os.path.join(import_dir, p), | 108 | "repo_path": os.path.join(import_dir, p), |
109 | "module_path": module_path, | 109 | "module_path": module_path, |
110 | "subdir": subdir, | 110 | "subdir": subdir, |
111 | "pathMajor": pathMajor } | 111 | "pathMajor": pathMajor } |
112 | 112 | ||
113 | for module_key in sorted(modules): | 113 | for module_key, module in modules.items(): |
114 | 114 | ||
115 | # only take the version which is explicitly listed | 115 | # only take the version which is explicitly listed |
116 | # as a dependency in the go.mod | 116 | # as a dependency in the go.mod |
117 | module = modules[module_key] | ||
118 | module_path = module['module_path'] | 117 | module_path = module['module_path'] |
119 | rootdir = module['repo_path'] | 118 | rootdir = module['repo_path'] |
120 | subdir = module['subdir'] | 119 | subdir = module['subdir'] |
@@ -139,7 +138,7 @@ python do_go_vendor() { | |||
139 | dst = os.path.join(vendor_dir, module_path) | 138 | dst = os.path.join(vendor_dir, module_path) |
140 | 139 | ||
141 | bb.debug(1, "cp %s --> %s" % (src, dst)) | 140 | bb.debug(1, "cp %s --> %s" % (src, dst)) |
142 | shutil.copytree(src, dst, symlinks=True, \ | 141 | shutil.copytree(src, dst, symlinks=True, dirs_exist_ok=True, \ |
143 | ignore=shutil.ignore_patterns(".git", \ | 142 | ignore=shutil.ignore_patterns(".git", \ |
144 | "vendor", \ | 143 | "vendor", \ |
145 | "*._test.go")) | 144 | "*._test.go")) |