summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/externalsrc.bbclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 9aabb426d9..8141f25e04 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -184,11 +184,19 @@ def srctree_hash_files(d, srcdir=None):
184 import tempfile 184 import tempfile
185 185
186 s_dir = srcdir or d.getVar('EXTERNALSRC') 186 s_dir = srcdir or d.getVar('EXTERNALSRC')
187 git_dir = os.path.join(s_dir, '.git') 187 git_dir = None
188 oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1') 188
189 try:
190 # git rev-parse returns the path relative to the current working
191 # directory
192 git_dir = os.path.join(s_dir,
193 subprocess.check_output(['git', 'rev-parse', '--git-dir'], cwd=s_dir).decode("utf-8").rstrip())
194 except subprocess.CalledProcessError:
195 pass
189 196
190 ret = " " 197 ret = " "
191 if os.path.exists(git_dir): 198 if git_dir is not None:
199 oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
192 with tempfile.NamedTemporaryFile(prefix='oe-devtool-index') as tmp_index: 200 with tempfile.NamedTemporaryFile(prefix='oe-devtool-index') as tmp_index:
193 # Clone index 201 # Clone index
194 shutil.copyfile(os.path.join(git_dir, 'index'), tmp_index.name) 202 shutil.copyfile(os.path.join(git_dir, 'index'), tmp_index.name)