On 01/17/2014 06:36 PM, Richard Purdie wrote:
On Fri, 2014-01-17 at 14:43 +0800, Robert Yang wrote:
+        # Keep the sigdata
+        if not re.match(re_sigdata, stfile):
+            oe.path.remove(stfile)

I'm not sure its worth the overhead of using regexps here. Can we not do
something simple like:

if ".sigdata." not in stfile:


Sounds better, I've updated the PULL:

git://git.pokylinux.org/poky-contrib rbt/clean_stamp

and here is the patch:

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 35c3f85..d4e0dcb 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -331,11 +331,17 @@ def sstate_clean_manifest(manifest, d):

 def sstate_clean(ss, d):
     import oe.path
+    import glob

     d2 = d.createCopy()
+    stamp_clean = d.getVar("STAMPCLEAN", True)
     extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
     if extrainf:
         d2.setVar("SSTATE_MANMACH", extrainf)
+        wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
+    else:
+        wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
+
     manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])

     if os.path.exists(manifest):
@@ -350,15 +356,11 @@ def sstate_clean(ss, d):
         for lock in locks:
             bb.utils.unlockfile(lock)

-    stfile = d.getVar("STAMP", True) + ".do_" + ss['task']
-    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" + ".*")
+    # Remove the current and previous stamps, but keep the sigdata
+    for stfile in glob.glob(wildcard_stfile):
+        # Keep the sigdata
+        if ".sigdata." not in stfile:
+            oe.path.remove(stfile)

 CLEANFUNCS += "sstate_cleanall"

// Robert

Cheers,

Richard



_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to