Patchwork rm_work: remove package and packages-split dirs

login
register
mail settings
Submitter Martin Jansa
Date Feb. 6, 2013, 1:26 p.m.
Message ID <1360157209-19641-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/44201/
State Accepted, archived
Headers show

Comments

Martin Jansa - Feb. 6, 2013, 1:26 p.m.
* as described in
  http://git.openembedded.org/openembedded-core/commit/?id=6107ee294afde395e39d084c33e8e94013c625a9

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/rm_work.bbclass | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
mike.looijmans@topic.nl - Feb. 6, 2013, 1:44 p.m.
(see comment below)

On 02/06/2013 02:26 PM, Martin Jansa wrote:
> * as described in
>    http://git.openembedded.org/openembedded-core/commit/?id=6107ee294afde395e39d084c33e8e94013c625a9
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>   meta/classes/rm_work.bbclass | 18 ++++++++++++------
>   1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
> index 997dcd1..5aa5f24 100644
> --- a/meta/classes/rm_work.bbclass
> +++ b/meta/classes/rm_work.bbclass
> @@ -17,15 +17,12 @@ do_rm_work () {
>       cd ${WORKDIR}
>       for dir in *
>       do
> -        if [ `basename ${S}` = $dir ]; then
> -            rm -rf $dir
> -        # The package and packages-split directories are retained by sstate for
> -        # do_package so we retain them here too. Anything in sstate 'plaindirs'
> -        # should be retained. Also retain logs and other files in temp.
> -        elif [ $dir != 'temp' ] && [ $dir != 'package' ]  && [ $dir != 'packages-split' ]; then
> +        # Retain only logs and other files in temp.
> +        if [ $dir != 'temp' ]; then
>               rm -rf $dir
>           fi
>       done
> +
>       # Need to add pseudo back or subsqeuent work in this workdir
>       # might fail since setscene may not rerun to recreate it
>       mkdir ${WORKDIR}/pseudo/
> @@ -54,6 +51,15 @@ do_rm_work () {
>                   i=dummy
>                   break
>                   ;;
> +            # We remove do_package entirely, including any
> +            # sstate version since otherwise we'd need to leave 'plaindirs' around
> +            # such as 'packages' and 'packages-split' and these can be large. No end
> +            # of chain tasks depend directly on do_package anymore.
> +            *do_package|*do_package_setscene)
> +                i=dummy
> +                rm -f $i;

Hmm, I think you intended "rm -f $dir" here? This would only remove a 
file named "dummy".

> +                break
> +                ;;
>               *_setscene*)
>                   i=dummy
>                   break
>

Mike.
Martin Jansa - Feb. 6, 2013, 2:06 p.m.
On Wed, Feb 06, 2013 at 02:44:29PM +0100, Mike Looijmans wrote:
> (see comment below)
> 
> On 02/06/2013 02:26 PM, Martin Jansa wrote:
> > * as described in
> >    http://git.openembedded.org/openembedded-core/commit/?id=6107ee294afde395e39d084c33e8e94013c625a9
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> >   meta/classes/rm_work.bbclass | 18 ++++++++++++------
> >   1 file changed, 12 insertions(+), 6 deletions(-)
> >
> > diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
> > index 997dcd1..5aa5f24 100644
> > --- a/meta/classes/rm_work.bbclass
> > +++ b/meta/classes/rm_work.bbclass
> > @@ -17,15 +17,12 @@ do_rm_work () {
> >       cd ${WORKDIR}
> >       for dir in *
> >       do
> > -        if [ `basename ${S}` = $dir ]; then
> > -            rm -rf $dir
> > -        # The package and packages-split directories are retained by sstate for
> > -        # do_package so we retain them here too. Anything in sstate 'plaindirs'
> > -        # should be retained. Also retain logs and other files in temp.
> > -        elif [ $dir != 'temp' ] && [ $dir != 'package' ]  && [ $dir != 'packages-split' ]; then
> > +        # Retain only logs and other files in temp.
> > +        if [ $dir != 'temp' ]; then
> >               rm -rf $dir
> >           fi
> >       done
> > +
> >       # Need to add pseudo back or subsqeuent work in this workdir
> >       # might fail since setscene may not rerun to recreate it
> >       mkdir ${WORKDIR}/pseudo/
> > @@ -54,6 +51,15 @@ do_rm_work () {
> >                   i=dummy
> >                   break
> >                   ;;
> > +            # We remove do_package entirely, including any
> > +            # sstate version since otherwise we'd need to leave 'plaindirs' around
> > +            # such as 'packages' and 'packages-split' and these can be large. No end
> > +            # of chain tasks depend directly on do_package anymore.
> > +            *do_package|*do_package_setscene)
> > +                i=dummy
> > +                rm -f $i;
> 
> Hmm, I think you intended "rm -f $dir" here? This would only remove a 
> file named "dummy".

Good catch thanks, it should be before i=dummy. I'm testing v3 now.

Interesting that after last rebuild I haven't found any
do_package,do_package_setscene stamps..

Cheers,

> > +                break
> > +                ;;
> >               *_setscene*)
> >                   i=dummy
> >                   break
> >
> 
> Mike.
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 997dcd1..5aa5f24 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -17,15 +17,12 @@  do_rm_work () {
     cd ${WORKDIR}
     for dir in *
     do
-        if [ `basename ${S}` = $dir ]; then
-            rm -rf $dir
-        # The package and packages-split directories are retained by sstate for 
-        # do_package so we retain them here too. Anything in sstate 'plaindirs' 
-        # should be retained. Also retain logs and other files in temp.
-        elif [ $dir != 'temp' ] && [ $dir != 'package' ]  && [ $dir != 'packages-split' ]; then
+        # Retain only logs and other files in temp.
+        if [ $dir != 'temp' ]; then
             rm -rf $dir
         fi
     done
+
     # Need to add pseudo back or subsqeuent work in this workdir
     # might fail since setscene may not rerun to recreate it
     mkdir ${WORKDIR}/pseudo/
@@ -54,6 +51,15 @@  do_rm_work () {
                 i=dummy
                 break
                 ;;
+            # We remove do_package entirely, including any
+            # sstate version since otherwise we'd need to leave 'plaindirs' around
+            # such as 'packages' and 'packages-split' and these can be large. No end
+            # of chain tasks depend directly on do_package anymore.
+            *do_package|*do_package_setscene)
+                i=dummy
+                rm -f $i;
+                break
+                ;;
             *_setscene*)
                 i=dummy
                 break