mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
toaster.bbclass: only scan files-in-image.txt if it exists
We can reach the method in toaster.bbclass which tries to read from the files-in-image.txt file via a build which doesn't create that file (e.g. "bitbake core-image-minimal -c rootfs"). This causes the build to fail with an exception. Check that this file exists before trying to read from it. [YOCTO #9784] (From OE-Core rev: 8b369cdd73ab17cdf834a591b97b25840caeb740) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ac339ece20
commit
843f7ae410
@@ -288,15 +288,22 @@ python toaster_buildhistory_dump() {
|
|||||||
images[target][dependsname] = {'size': 0, 'depends' : []}
|
images[target][dependsname] = {'size': 0, 'depends' : []}
|
||||||
images[target][pname]['depends'].append((dependsname, deptype))
|
images[target][pname]['depends'].append((dependsname, deptype))
|
||||||
|
|
||||||
with open("%s/files-in-image.txt" % installed_img_path, "r") as fin:
|
# files-in-image.txt is only generated if an image file is created,
|
||||||
for line in fin:
|
# so the file entries ('syms', 'dirs', 'files') for a target will be
|
||||||
lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
|
# empty for rootfs builds and other "image" tasks which don't
|
||||||
if lc[0].startswith("l"):
|
# produce image files
|
||||||
files[target]['syms'].append(lc)
|
# (e.g. "bitbake core-image-minimal -c populate_sdk")
|
||||||
elif lc[0].startswith("d"):
|
files_in_image_path = "%s/files-in-image.txt" % installed_img_path
|
||||||
files[target]['dirs'].append(lc)
|
if os.path.exists(files_in_image_path):
|
||||||
else:
|
with open(files_in_image_path, "r") as fin:
|
||||||
files[target]['files'].append(lc)
|
for line in fin:
|
||||||
|
lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
|
||||||
|
if lc[0].startswith("l"):
|
||||||
|
files[target]['syms'].append(lc)
|
||||||
|
elif lc[0].startswith("d"):
|
||||||
|
files[target]['dirs'].append(lc)
|
||||||
|
else:
|
||||||
|
files[target]['files'].append(lc)
|
||||||
|
|
||||||
for pname in images[target]:
|
for pname in images[target]:
|
||||||
if not pname in allpkgs:
|
if not pname in allpkgs:
|
||||||
|
|||||||
Reference in New Issue
Block a user