fixes for when SWUPD_BUNDLES is undefined
cover fixes for when SWUPD_BUNDLES is undefined
Hi,
The following set of patches were necessary for me to make meta-swupd work again as we don't use SWUPD_BUNDLES.
Cheers,
Andre'
PATCH 1/3 swupd-image.bbclass: don't fail parsing if SWUPD_BUNDLES is undefined
ERROR: Error for ...image.bb, dependency ${@' does not contain exactly one ':' character.
Task 'depends' should be specified in the form 'packagename:task'
ERROR: Command execution failed: Exited with 1
--- classes/swupd-image.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
classes/swupd-image.bbclass +1 -1
@@ -322,7 +322,7 @@ addtask stage_swupd_inputs after do_swupd_list_bundle before do_swupd_update do_stage_swupd_inputs[dirs] = "${SWUPDIMAGEDIR} ${SWUPDMANIFESTDIR} ${DEPLOY_DIR_SWUPD}/maps/" do_stage_swupd_inputs[depends] += " \ virtual/fakeroot-native:do_populate_sysroot \ - ${@ ' '.join(['bundle-${SWUPD_IMAGE_PN}-%s:do_swupd_list_bundle' % x for x in '${SWUPD_BUNDLES}'.split()]) } \ + ${@ ' '.join(['bundle-${SWUPD_IMAGE_PN}-%s:do_swupd_list_bundle' % x for x in (d.getVar('SWUPD_BUNDLES') or '').split()]) } \ " python do_fetch_swupd_inputs () {
Signature · 1 line
2.11.0
PATCH 2/3 path.py: always clean up temporary file in copyxattrfiles()
In reply to André DraszikUse try: finally: to make sure the file is removed even on exceptions.
--- lib/swupd/path.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
lib/swupd/path.py +6 -4
@@ -50,10 +50,12 @@ def copyxattrfiles(d, filelist, src, dst, archive=False): bb.fatal('Extracting files from an archive and writing into an archive not implemented yet.') else: cmd = "bsdtar --no-recursion -C %s -xf %s -T %s" % (dst, src, copyfile) - output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) - if output: - bb.fatal('Unexpected output from the following command:\n%s\n%s' % (cmd, output)) - os.remove(copyfile) + try: + output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) + if output: + bb.fatal('Unexpected output from the following command:\n%s\n%s' % (cmd, output)) + finally: + os.remove(copyfile) def remove_empty_directories(tree):
Signature · 1 line
2.11.0
PATCH 3/3 bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
In reply to André DraszikWhen SWUPD_BUNDLES is not set, exceptions are thrown, stopping the build - there are two issues in here:
- the debug statement references a non-existent variable, 'bundle' was renamed to fulltar
- copyxattrfiles() needs a list of files as 2nd argument, not a filename of a file which contains this list
This got broken in commit 6c097131ad39
("meta-swupd: support rm_work.bbclass") while support for rm_work was being added.
--- lib/swupd/bundles.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
lib/swupd/bundles.py +3 -2
@@ -72,8 +72,9 @@ def copy_core_contents(d): if not havebundles: rootfs = d.getVar('IMAGE_ROOTFS', True) workdir = d.getVar('WORKDIR', True) - bb.debug(1, "Copying from image rootfs (%s) to full bundle (%s)" % (rootfs, bundle)) - swupd.path.copyxattrfiles(d, source + contentsuffix, rootfs, fulltar, True) + bb.debug(1, "Copying from image rootfs (%s) to full bundle (%s)" % (rootfs, fulltar)) + swupd.path.copyxattrfiles(d, swupd.utils.manifest_to_file_list(source + contentsuffix), + rootfs, fulltar, True) else: mega_archive = d.getVar('MEGA_IMAGE_ARCHIVE', True) if os.path.exists(fulltar):
Signature · 1 line
2.11.0
Re: [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
Quoted 10 lines · André Draszik
When
SWUPD_BUNDLESis not set, exceptions are thrown, stopping the build - there are two issues in here:
- the debug statement references a non-existent variable, 'bundle' was renamed to fulltar
-copyxattrfiles()needs a list of files as 2nd argument, not a filename of a file which contains this listThis got broken in commit
6c097131ad39
("meta-swupd: support rm_work.bbclass") while support forrm_workwas being added.
I should have fixed that already in commit531a8e636 "bundles.py: fix "no bundles" special case". Can you rebase onto current master and retest.
The other patches look fine, I'm just wondering why I hadn't run into that. Perhaps I was working with an empty SWUPD_BUNDLES instead of an unset one.
Signature · 6 lines
Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.
Re: [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
Quoted 8 lines · Patrick Ohly
Quoted 7 lines · André Draszik
When
SWUPD_BUNDLESis not set, exceptions are thrown, stopping the build - there are two issues in here:
- the debug statement references a non-existent variable, 'bundle' was renamed to fulltar
-copyxattrfiles()needs a list of files as 2nd argument, not a filename of a file which contains this list
Quoted 7 lines
Quoted 3 lines
This got broken in commit
6c097131ad39
("meta-swupd: support rm_work.bbclass") while support forrm_workwas being added.I should have fixed that already in commit
531a8e636"bundles.py: fix "no bundles" special case". Can you rebase onto current master and retest.
Never mind, my bad. The commit you mentioned is after my fix, so in other words, I fixed it, changed something, and broke it again. Clearly this whole layer needs automated test cases :-/
Something to do for a maintainer with a bit more time available. There is https://bugzilla.yoctoproject.org/show_bug.cgi?id=9783 for it, but I don't think I'll be able to work on that anytime soon.
Signature · 6 lines
Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.