summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index 0cdc8301d1..fd5089c075 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -98,12 +98,14 @@ class GitSM(Git):
98 98
99 # Correct the submodule references to the local download version... 99 # Correct the submodule references to the local download version...
100 runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_paths[module]}, d, workdir=ud.clonedir) 100 runfetchcmd("%(basecmd)s config submodule.%(module)s.url %(url)s" % {'basecmd': ud.basecmd, 'module': module, 'url' : local_paths[module]}, d, workdir=ud.clonedir)
101 try: 101
102 os.mkdir(os.path.join(ud.clonedir, 'modules')) 102 symlink_path = os.path.join(ud.clonedir, 'modules', paths[module])
103 except OSError: 103 if not os.path.exists(symlink_path):
104 pass 104 try:
105 if not os.path.exists(os.path.join(ud.clonedir, 'modules', paths[module])): 105 os.makedirs(os.path.dirname(symlink_path), exist_ok=True)
106 os.symlink(local_paths[module], os.path.join(ud.clonedir, 'modules', paths[module])) 106 except OSError:
107 pass
108 os.symlink(local_paths[module], symlink_path)
107 109
108 return True 110 return True
109 111
@@ -148,6 +150,7 @@ class GitSM(Git):
148 if os.path.exists(modpath): 150 if os.path.exists(modpath):
149 target = os.path.dirname(modpath) 151 target = os.path.dirname(modpath)
150 152
153 os.makedirs(os.path.dirname(target), exist_ok=True)
151 runfetchcmd("cp -fpLR %s %s" % (srcpath, target), d) 154 runfetchcmd("cp -fpLR %s %s" % (srcpath, target), d)
152 elif os.path.exists(modpath): 155 elif os.path.exists(modpath):
153 # Module already exists, likely unpacked from a shallow mirror clone 156 # Module already exists, likely unpacked from a shallow mirror clone