archiver: avoid empty incfile in ar_recipe

do_ar_recipe fails on perf recipe on line:

include ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perf-perl.inc', '', d)}

1. "${...}" part expands into empty string
2. bb.utils.which() takes empty string and returns first directory name from bbpath
3. shutil.copy() fails on copying directory:

Exception: IsADirectoryError: [Errno 21] Is a directory: ......

Hence, check "incfile" variable on each step.

(From OE-Core rev: 3b393da7d2d15de12e2a8a9c11591078b40b188a)

Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
grygorii tertychnyi
2019-11-01 09:10:43 +02:00
committed by Richard Purdie
parent 3aed62d687
commit 6961d96cba

View File

@@ -441,9 +441,10 @@ python do_ar_recipe () {
incfile = include_re.match(line).group(1)
if incfile:
incfile = d.expand(incfile)
if incfile:
incfile = bb.utils.which(bbpath, incfile)
if incfile:
shutil.copy(incfile, outdir)
if incfile:
shutil.copy(incfile, outdir)
create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR'))
bb.utils.remove(outdir, recurse=True)