]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: extract: fix usage with kern-tools-native
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 27 Nov 2017 01:48:54 +0000 (14:48 +1300)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 5 Dec 2017 01:39:23 +0000 (14:39 +1300)
The kern-tools-native recipe as it currently stands is unusual in that
it fetches source from a repository but sets S = "${WORKDIR}" which
causes some problems. First you get a failure because we're calling "git
commit" unconditionally even if there are no local files, and there
aren't any in this case which means the commit fails.

After that's fixed, we hit another problem where "recipe-sysroot-native"
subdirectory appears in the extracted source tree. We don't want that so
exclude it from copying.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
meta/classes/devtool-source.bbclass
scripts/lib/devtool/standard.py

index 56882a41d84869e892ba96a4413b404f5e019177..540a60289a8244bb3f5fe78a9a455e1fed882bf6 100644 (file)
@@ -118,7 +118,13 @@ python devtool_post_unpack() {
                         os.path.basename(fname) not in recipe_patches]
         srcsubdir = d.getVar('DEVTOOL_PATCH_SRCDIR')
         # Move source files to S
+        excludevars = ['RECIPE_SYSROOT', 'RECIPE_SYSROOT_NATIVE']
+        excludepaths = []
+        for excludevar in excludevars:
+            excludepaths.append(os.path.relpath(d.getVar(excludevar), workdir) + os.sep)
         for path in src_files:
+            if path.startswith(tuple(excludepaths)):
+                continue
             _move_file(os.path.join(workdir, path),
                         os.path.join(srcsubdir, path))
     elif os.path.dirname(srcsubdir) != workdir:
index cdd2346cb6dbf0fbabbf76d2b4d31c064b55bbf8..a6656e4e67eb6be45116121da836566a9ac74a93 100644 (file)
@@ -634,9 +634,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
                         addfiles.append(os.path.join(relpth, fn))
                 if addfiles:
                     bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
-                useroptions = []
-                oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
-                bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
+                    useroptions = []
+                    oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
+                    bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
 
         if is_kernel_yocto:
             logger.info('Copying kernel config to srctree')