Patchwork [1/9] tar: fix build

login
register
mail settings
Submitter Nitin A Kamble
Date May 23, 2012, 12:05 a.m.
Message ID <9fcc40151424883e9f660dfdd3a3eb52213701c1.1337731469.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/28369/
State New
Headers show

Comments

Nitin A Kamble - May 23, 2012, 12:05 a.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

Avoid this error:
| rmdir: failed to remove `/srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/tar-1.26-r1/image/usr/sbin/': No such file or directory
NOTE: package tar-1.26-r1: task do_install: Failed

no PR bump as no change in the output.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta/recipes-extended/tar/tar.inc |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Gary Thomas - May 23, 2012, 10:44 a.m.
On 2012-05-22 18:05, nitin.a.kamble@intel.com wrote:
> From: Nitin A Kamble<nitin.a.kamble@intel.com>
>
> Avoid this error:
> | rmdir: failed to remove `/srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/tar-1.26-r1/image/usr/sbin/': No such file or directory
> NOTE: package tar-1.26-r1: task do_install: Failed
>
> no PR bump as no change in the output.
>
> Signed-off-by: Nitin A Kamble<nitin.a.kamble@intel.com>
> ---
>   meta/recipes-extended/tar/tar.inc |    8 ++++++--
>   1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-extended/tar/tar.inc b/meta/recipes-extended/tar/tar.inc
> index 0533b82..5c2325a 100644
> --- a/meta/recipes-extended/tar/tar.inc
> +++ b/meta/recipes-extended/tar/tar.inc
> @@ -18,8 +18,12 @@ do_install () {
>   do_install_extra () {
>       install -d ${D}${base_bindir}
>       mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN}
> -    rmdir ${D}${bindir}/
> -    rmdir ${D}${sbindir}/
> +    if [ -d ${D}${bindir}/ ] ; then
> +        rmdir ${D}${bindir}/
> +    fi
> +    if [ -d ${D}${sbindir}/ ] ; then
> +        rmdir ${D}${sbindir}/
> +    fi
>       mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
>   }
>

Why not just use
   rm -fr ${D}${bindir}
etc?  No need for all the extra testing...
Richard Purdie - May 23, 2012, 1:48 p.m.
On Wed, 2012-05-23 at 04:44 -0600, Gary Thomas wrote:
> On 2012-05-22 18:05, nitin.a.kamble@intel.com wrote:
> > From: Nitin A Kamble<nitin.a.kamble@intel.com>
> >
> > Avoid this error:
> > | rmdir: failed to remove `/srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/tar-1.26-r1/image/usr/sbin/': No such file or directory
> > NOTE: package tar-1.26-r1: task do_install: Failed
> >
> > no PR bump as no change in the output.
> >
> > Signed-off-by: Nitin A Kamble<nitin.a.kamble@intel.com>
> > ---
> >   meta/recipes-extended/tar/tar.inc |    8 ++++++--
> >   1 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-extended/tar/tar.inc b/meta/recipes-extended/tar/tar.inc
> > index 0533b82..5c2325a 100644
> > --- a/meta/recipes-extended/tar/tar.inc
> > +++ b/meta/recipes-extended/tar/tar.inc
> > @@ -18,8 +18,12 @@ do_install () {
> >   do_install_extra () {
> >       install -d ${D}${base_bindir}
> >       mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN}
> > -    rmdir ${D}${bindir}/
> > -    rmdir ${D}${sbindir}/
> > +    if [ -d ${D}${bindir}/ ] ; then
> > +        rmdir ${D}${bindir}/
> > +    fi
> > +    if [ -d ${D}${sbindir}/ ] ; then
> > +        rmdir ${D}${sbindir}/
> > +    fi
> >       mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
> >   }
> >
> 
> Why not just use
>    rm -fr ${D}${bindir}
> etc?  No need for all the extra testing...

I've mentioned this once before however I'll do so again. I think these
empty directories were a bug in automake. It looks like automake has
fixed that problem and no longer generates them. I think the correct
thing to do is simply remove the rmdir.

The reason we used rmdir instead of rm is we wanted to know if these
suddenly started containing files, not silently delete them.

Cheers,

Richard
Nitin A Kamble - May 23, 2012, 10:08 p.m.
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Richard Purdie
> Sent: Wednesday, May 23, 2012 6:48 AM
> To: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [PATCH 1/9] tar: fix build
> 
> On Wed, 2012-05-23 at 04:44 -0600, Gary Thomas wrote:
> > On 2012-05-22 18:05, nitin.a.kamble@intel.com wrote:
> > > From: Nitin A Kamble<nitin.a.kamble@intel.com>
> > >
> > > Avoid this error:
> > > | rmdir: failed to remove
> > > | `/srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/tar-
> 1
> > > | .26-r1/image/usr/sbin/': No such file or directory
> > > NOTE: package tar-1.26-r1: task do_install: Failed
> > >
> > > no PR bump as no change in the output.
> > >
> > > Signed-off-by: Nitin A Kamble<nitin.a.kamble@intel.com>
> > > ---
> > >   meta/recipes-extended/tar/tar.inc |    8 ++++++--
> > >   1 files changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta/recipes-extended/tar/tar.inc
> > > b/meta/recipes-extended/tar/tar.inc
> > > index 0533b82..5c2325a 100644
> > > --- a/meta/recipes-extended/tar/tar.inc
> > > +++ b/meta/recipes-extended/tar/tar.inc
> > > @@ -18,8 +18,12 @@ do_install () {
> > >   do_install_extra () {
> > >       install -d ${D}${base_bindir}
> > >       mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN}
> > > -    rmdir ${D}${bindir}/
> > > -    rmdir ${D}${sbindir}/
> > > +    if [ -d ${D}${bindir}/ ] ; then
> > > +        rmdir ${D}${bindir}/
> > > +    fi
> > > +    if [ -d ${D}${sbindir}/ ] ; then
> > > +        rmdir ${D}${sbindir}/
> > > +    fi
> > >       mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
> > >   }
> > >
> >
> > Why not just use
> >    rm -fr ${D}${bindir}
> > etc?  No need for all the extra testing...
> 
> I've mentioned this once before however I'll do so again. I think these
> empty directories were a bug in automake. It looks like automake has
> fixed that problem and no longer generates them. I think the correct
> thing to do is simply remove the rmdir.
> 
> The reason we used rmdir instead of rm is we wanted to know if these
> suddenly started containing files, not silently delete them.
> 
> Cheers,
> 
> Richard
> 

Hi Richard,
  I was trying to make the commits compatible with both automake 1.11 & automake 1.12. Now after discussions with Saul, I understand that these commits will go after automake 1.12 update goes in. In that case we can remove these rmdir statements.

Thanks,
Nitin

Patch

diff --git a/meta/recipes-extended/tar/tar.inc b/meta/recipes-extended/tar/tar.inc
index 0533b82..5c2325a 100644
--- a/meta/recipes-extended/tar/tar.inc
+++ b/meta/recipes-extended/tar/tar.inc
@@ -18,8 +18,12 @@  do_install () {
 do_install_extra () {
     install -d ${D}${base_bindir}
     mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN}
-    rmdir ${D}${bindir}/
-    rmdir ${D}${sbindir}/
+    if [ -d ${D}${bindir}/ ] ; then 
+        rmdir ${D}${bindir}/
+    fi
+    if [ -d ${D}${sbindir}/ ] ; then 
+        rmdir ${D}${sbindir}/
+    fi
     mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
 }