]> code.ossystems Code Review - openembedded-core.git/commitdiff
externalsrc: Add optional srcdir arg to srctree_hash_files
authorOla x Nilsson <ola.x.nilsson@axis.com>
Thu, 22 Dec 2016 13:59:49 +0000 (14:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Jan 2017 13:27:00 +0000 (13:27 +0000)
Make it easier to reuse the function for other dirs than EXTERNALSRC.

Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/externalsrc.bbclass

index eec5e615648b8e127a1d11657157ef4ef2196bb6..6ec46a6b15f58b449fea42c56fd455322f57c808 100644 (file)
@@ -143,12 +143,12 @@ python externalsrc_compile_prefunc() {
     bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC')))
 }
 
-def srctree_hash_files(d):
+def srctree_hash_files(d, srcdir=None):
     import shutil
     import subprocess
     import tempfile
 
-    s_dir = d.getVar('EXTERNALSRC')
+    s_dir = srcdir or d.getVar('EXTERNALSRC')
     git_dir = os.path.join(s_dir, '.git')
     oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
 
@@ -166,7 +166,7 @@ def srctree_hash_files(d):
             fobj.write(sha1)
         ret = oe_hash_file + ':True'
     else:
-        ret = d.getVar('EXTERNALSRC') + '/*:True'
+        ret = s_dir + '/*:True'
     return ret
 
 def srctree_configure_hash_files(d):