Patchwork image_types.bbclass: fix link creation failure if the target already exists

login
register
mail settings
Submitter Richard Purdie
Date March 2, 2012, 1:20 p.m.
Message ID <1330694440.18076.1.camel@ted>
Download mbox | patch
Permalink /patch/22589/
State Accepted
Commit b24d4bcde21b013e48eaffea5f3a70d8b1df1047
Headers show

Comments

Richard Purdie - March 2, 2012, 1:20 p.m.
On Fri, 2012-03-02 at 13:48 +0100, Andreas Müller wrote:
> On Fri, Mar 2, 2012 at 1:38 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Fri, 2012-03-02 at 13:29 +0100, Andreas Müller wrote:
> >> On Thu, Mar 1, 2012 at 4:50 PM, Richard Purdie
> >> | ln: failed to create symbolic link
> >> `/home/andreas/tmp/oe-core-eglibc/deploy/images/overo/xfce-base-image-overo.tar.bz2':
> >> File exists
> >> NOTE: package xfce-base-image-1.0-r0: task do_rootfs: Failed
> >
> > Could you see what the IMAGE_FSTYPES variable contains please?
> >
> > (bitbake xfce-base-image -e | grep ^IMAGE_FSTYPES)
> >
> > The code shouldn't be trying to create this symlink more than once so
> > whilst I understand the intent of the patch adding -f, I'd like to
> > understand the root cause of the problem to ensure there isn't some
> > other issue.
> >
> Agreed:
> 
> IMAGE_FSTYPES="tar.bz2 tar.bz2"
> 
> Seems a 'sum' of local.conf
> 
> IMAGE_FSTYPES = "tar.bz2"
> 
> and machine.conf
> 
> IMAGE_FSTYPES += "tar.bz2"

Thanks, that helps a lot. I'd tested "tar tar" and "tar.gz tar.bz2" but
not that :). I think something like:


should fix this? 

Cheers,

Richard
Petr Štetiar - March 2, 2012, 10:01 p.m.
Richard Purdie <richard.purdie@linuxfoundation.org> [2012-03-02 13:20:40]:

> Thanks, that helps a lot. I'd tested "tar tar" and "tar.gz tar.bz2" but
> not that :). I think something like:
> 
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 681571d..1bf59a5 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -17,7 +17,8 @@ def get_imagecmds(d):
>                      types.append(basetype)
>                  if basetype not in cimages:
>                      cimages[basetype] = []
> -                cimages[basetype].append(ctype)
> +                if ctype not in cimages[basetype]:
> +                    cimages[basetype].append(ctype)
>                  break
>          if not basetype and type not in types:
>              types.append(type)
> 
> should fix this?

It's ok now. Thanks.

-- ynezz

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 681571d..1bf59a5 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -17,7 +17,8 @@  def get_imagecmds(d):
                     types.append(basetype)
                 if basetype not in cimages:
                     cimages[basetype] = []
-                cimages[basetype].append(ctype)
+                if ctype not in cimages[basetype]:
+                    cimages[basetype].append(ctype)
                 break
         if not basetype and type not in types:
             types.append(type)