devtool: modify command fails to ignore source files
PATCH v2 1/1 devtool: modify command fails to ignore source files
With recent changes to recipeutils, the list of local files returned by get_recipe_local_files could possibly include source files. This only happens when the recipe contains a SRC_URI using subdir= to put files in the source tree. These files should be ignored when populating the list of local files for oe-local-files directory.
[YOCTO #10326]
introduced in
OE-Core revision 9069fef5dad5a873c8a8f720f7bcbc7625556309
--- scripts/lib/devtool/standard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/lib/devtool/standard.py +5 -1
@@ -568,8 +568,12 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d): recipe_patches = [os.path.basename(patch) for patch in oe.recipeutils.get_recipe_patches(crd)] local_files = oe.recipeutils.get_recipe_local_files(crd) + + # Ignore local files with subdir={BP} + srcabspath = os.path.abspath(srcsubdir) local_files = [fname for fname in local_files if - os.path.exists(os.path.join(workdir, fname))] + os.path.exists(os.path.join(workdir, fname)) and + not os.path.join(workdir, fname).startswith(srcabspath)] if local_files: for fname in local_files: _move_file(os.path.join(workdir, fname),
Signature · 1 line
2.10.0
Quoted 31 lines · On Sun, 02 Oct 2016 16:58:24 Stephano Cetola wrote:
With recent changes to recipeutils, the list of local files returned by
get_recipe_local_filescould possibly include source files. This only happens when the recipe contains aSRC_URIusing subdir= to put files in the source tree. These files should be ignored when populating the list of local files for oe-local-files directory.[YOCTO #10326]
introduced in
OE-Core revision9069fef5dad5a873c8a8f720f7bcbc7625556309Signed-off-by Stephano Cetola <[email protected]>--- scripts/lib/devtool/standard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/scripts/lib/devtool/standard.pyindex 8319145..b6f9e12 100644scripts/lib/devtool/standard.py +0
-0@@ -568,8 +568,12 @@ def _extract_source(srctree, keep_temp, devbranch,sync, d):
recipe_patches= [os.path.basename(patch)for patch in
oe.recipeutils.get_recipe_patches(crd)]
local_files=oe.recipeutils.get_recipe_local_files(crd)scripts/lib/devtool/standard.py +5
-1+ + # Ignore local files with subdir={BP} + srcabspath = os.path.abspath(srcsubdir) local_files = [fname for fname in local_files if - os.path.exists(os.path.join(workdir, fname))] + os.path.exists(os.path.join(workdir, fname)) and + not os.path.join(workdir,
Quoted 3 lines
fname).startswith(srcabspath)] if
local_files:
for fname inlocal_files:
_move_file(os.path.join(workdir, fname),
OK - this looks better. One minor tweak I'd suggest though is to add os.sep on the end of srcabspath so we can be sure we're matching that directory and not one whose name starts with the same string.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Quoted 31 lines · Paul Eggleton
Quoted 30 lines · On Sun, 02 Oct 2016 16:58:24 Stephano Cetola wrote:
With recent changes to recipeutils, the list of local files returned by
get_recipe_local_filescould possibly include source files. This only happens when the recipe contains aSRC_URIusing subdir= to put files in the source tree. These files should be ignored when populating the list of local files for oe-local-files directory.[YOCTO #10326]
introduced in
OE-Core revision9069fef5dad5a873c8a8f720f7bcbc7625556309Signed-off-by Stephano Cetola <[email protected]>--- scripts/lib/devtool/standard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/scripts/lib/devtool/standard.pyindex 8319145..b6f9e12 100644scripts/lib/devtool/standard.py +0
-0@@ -568,8 +568,12 @@ def _extract_source(srctree, keep_temp, devbranch,sync, d):
recipe_patches= [os.path.basename(patch)for patch in
oe.recipeutils.get_recipe_patches(crd)]
local_files=oe.recipeutils.get_recipe_local_files(crd)scripts/lib/devtool/standard.py +4
-1+ + # Ignore local files with subdir={BP} + srcabspath = os.path.abspath(srcsubdir) local_files = [fname for fname in local_files if - os.path.exists(os.path.join(workdir, fname))] + os.path.exists(os.path.join(workdir, fname)) and
Quoted 8 lines
Quoted 4 lines
+ not os.path.join(workdir,
fname).startswith(srcabspath)] iflocal_files:
for fname inlocal_files:
_move_file(os.path.join(workdir, fname),OK - this looks better. One minor tweak I'd suggest though is to add os.sep on the end of srcabspath so we can be sure we're matching that directory and not one whose name starts with the same string.
Good point. I'll add this in and resubmit.
Quoted 8 lines
Cheers,
PaulSignature · 2 lines
Paul Eggleton Intel Open Source Technology Centre