Patchwork sstate_clean() overzealous?

login
register
mail settings
Submitter Phil Blundell
Date Oct. 4, 2011, 3:03 p.m.
Message ID <1317740599.13337.43.camel@phil-desktop>
Download mbox | patch
Permalink /patch/12741/
State New, archived
Headers show

Comments

Phil Blundell - Oct. 4, 2011, 3:03 p.m.
On Tue, 2011-10-04 at 11:54 +0100, Richard Purdie wrote:
> I think we need to teach this clean function about stamp-extra-info and
> instead of stfile + ".*", remove stfile + ".*." + stamp-extra-info if
> stamp-extra-info is set. That would likely fix the problem you're
> seeing.

Okay, thanks.  I applied this change locally:

and it does indeed seem to resolve the problem I was seeing before.

p.
Richard Purdie - Oct. 4, 2011, 3:42 p.m.
On Tue, 2011-10-04 at 16:03 +0100, Phil Blundell wrote:
> On Tue, 2011-10-04 at 11:54 +0100, Richard Purdie wrote:
> > I think we need to teach this clean function about stamp-extra-info and
> > instead of stfile + ".*", remove stfile + ".*." + stamp-extra-info if
> > stamp-extra-info is set. That would likely fix the problem you're
> > seeing.
> 
> Okay, thanks.  I applied this change locally:
> 
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index 91f209a..7f38800 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -258,10 +258,15 @@ def sstate_clean(ss, d):
>              bb.utils.unlockfile(lock)
>  
>      stfile = d.getVar("STAMP", True) + ".do_" + ss['task']
> +    extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info')
>      oe.path.remove(stfile)
>      oe.path.remove(stfile + "_setscene")
> -    oe.path.remove(stfile + ".*")
> -    oe.path.remove(stfile + "_setscene" + ".*")
> +    if extrainf:
> +        oe.path.remove(stfile + ".*." + extrainf)
> +       oe.path.remove(stfile + "_setscene" + ".*." + extrainf)

Thinking further about this it may need to be ".*" instead of ".*.". I
suspect with the above it wouldn't be wiping out some of the stamps it
should be with OE-Core and the Basic siggen code. BasicHash would work
though.

Cheers,

Richard

Patch

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 91f209a..7f38800 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -258,10 +258,15 @@  def sstate_clean(ss, d):
             bb.utils.unlockfile(lock)
 
     stfile = d.getVar("STAMP", True) + ".do_" + ss['task']
+    extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info')
     oe.path.remove(stfile)
     oe.path.remove(stfile + "_setscene")
-    oe.path.remove(stfile + ".*")
-    oe.path.remove(stfile + "_setscene" + ".*")
+    if extrainf:
+        oe.path.remove(stfile + ".*." + extrainf)
+       oe.path.remove(stfile + "_setscene" + ".*." + extrainf)
+    else:
+        oe.path.remove(stfile + ".*")
+       oe.path.remove(stfile + "_setscene" + ".*")
 
 CLEANFUNCS += "sstate_cleanall"