All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-swupd][PATCH 0/3] fixes for when SWUPD_BUNDLES is undefined
@ 2017-02-16 14:58 André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 1/3] swupd-image.bbclass: don't fail parsing if " André Draszik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: André Draszik @ 2017-02-16 14:58 UTC (permalink / raw)
  To: yocto

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'



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [meta-swupd][PATCH 1/3] swupd-image.bbclass: don't fail parsing if SWUPD_BUNDLES is undefined
  2017-02-16 14:58 [meta-swupd][PATCH 0/3] fixes for when SWUPD_BUNDLES is undefined André Draszik
@ 2017-02-16 14:58 ` André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 2/3] path.py: always clean up temporary file in copyxattrfiles() André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES André Draszik
  2 siblings, 0 replies; 6+ messages in thread
From: André Draszik @ 2017-02-16 14:58 UTC (permalink / raw)
  To: yocto

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

Signed-off-by: André Draszik <git@andred.net>
---
 classes/swupd-image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass
index 771a416..d8383ff 100644
--- a/classes/swupd-image.bbclass
+++ b/classes/swupd-image.bbclass
@@ -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 () {
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-swupd][PATCH 2/3] path.py: always clean up temporary file in copyxattrfiles()
  2017-02-16 14:58 [meta-swupd][PATCH 0/3] fixes for when SWUPD_BUNDLES is undefined André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 1/3] swupd-image.bbclass: don't fail parsing if " André Draszik
@ 2017-02-16 14:58 ` André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES André Draszik
  2 siblings, 0 replies; 6+ messages in thread
From: André Draszik @ 2017-02-16 14:58 UTC (permalink / raw)
  To: yocto

Use try: finally: to make sure the file is removed even
on exceptions.

Signed-off-by: André Draszik <git@andred.net>
---
 lib/swupd/path.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/swupd/path.py b/lib/swupd/path.py
index 61e979e..a55c22c 100644
--- a/lib/swupd/path.py
+++ b/lib/swupd/path.py
@@ -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):
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
  2017-02-16 14:58 [meta-swupd][PATCH 0/3] fixes for when SWUPD_BUNDLES is undefined André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 1/3] swupd-image.bbclass: don't fail parsing if " André Draszik
  2017-02-16 14:58 ` [meta-swupd][PATCH 2/3] path.py: always clean up temporary file in copyxattrfiles() André Draszik
@ 2017-02-16 14:58 ` André Draszik
  2017-02-16 15:41   ` Patrick Ohly
  2 siblings, 1 reply; 6+ messages in thread
From: André Draszik @ 2017-02-16 14:58 UTC (permalink / raw)
  To: yocto

When 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.

Signed-off-by: André Draszik <git@andred.net>
---
 lib/swupd/bundles.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/swupd/bundles.py b/lib/swupd/bundles.py
index 24947a8..b4c6f49 100644
--- a/lib/swupd/bundles.py
+++ b/lib/swupd/bundles.py
@@ -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):
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
  2017-02-16 14:58 ` [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES André Draszik
@ 2017-02-16 15:41   ` Patrick Ohly
  2017-02-16 15:50     ` Patrick Ohly
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Ohly @ 2017-02-16 15:41 UTC (permalink / raw)
  To: André Draszik; +Cc: yocto

On Thu, 2017-02-16 at 14:58 +0000, André Draszik wrote:
> When 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.

I should have fixed that already in commit 
531a8e636 "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.

-- 
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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES
  2017-02-16 15:41   ` Patrick Ohly
@ 2017-02-16 15:50     ` Patrick Ohly
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick Ohly @ 2017-02-16 15:50 UTC (permalink / raw)
  To: André Draszik; +Cc: yocto

On Thu, 2017-02-16 at 16:41 +0100, Patrick Ohly wrote:
> On Thu, 2017-02-16 at 14:58 +0000, André Draszik wrote:
> > When 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.
> 
> 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.

-- 
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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-16 15:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 14:58 [meta-swupd][PATCH 0/3] fixes for when SWUPD_BUNDLES is undefined André Draszik
2017-02-16 14:58 ` [meta-swupd][PATCH 1/3] swupd-image.bbclass: don't fail parsing if " André Draszik
2017-02-16 14:58 ` [meta-swupd][PATCH 2/3] path.py: always clean up temporary file in copyxattrfiles() André Draszik
2017-02-16 14:58 ` [meta-swupd][PATCH 3/3] bundles.py: fix copying of full image to full bundle when no SWUPD_BUNDLES André Draszik
2017-02-16 15:41   ` Patrick Ohly
2017-02-16 15:50     ` Patrick Ohly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.