summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/sstate.bbclass31
1 files changed, 22 insertions, 9 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 35c3f85cfc..23d7de6556 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -331,11 +331,17 @@ def sstate_clean_manifest(manifest, d):
331 331
332def sstate_clean(ss, d): 332def sstate_clean(ss, d):
333 import oe.path 333 import oe.path
334 import glob
334 335
335 d2 = d.createCopy() 336 d2 = d.createCopy()
337 stamp_clean = d.getVar("STAMPCLEAN", True)
336 extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True) 338 extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
337 if extrainf: 339 if extrainf:
338 d2.setVar("SSTATE_MANMACH", extrainf) 340 d2.setVar("SSTATE_MANMACH", extrainf)
341 wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
342 else:
343 wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
344
339 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name']) 345 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
340 346
341 if os.path.exists(manifest): 347 if os.path.exists(manifest):
@@ -350,15 +356,22 @@ def sstate_clean(ss, d):
350 for lock in locks: 356 for lock in locks:
351 bb.utils.unlockfile(lock) 357 bb.utils.unlockfile(lock)
352 358
353 stfile = d.getVar("STAMP", True) + ".do_" + ss['task'] 359 # Remove the current and previous stamps, but keep the sigdata.
354 oe.path.remove(stfile) 360 #
355 oe.path.remove(stfile + "_setscene") 361 # The glob() matches do_task* which may match multiple tasks, for
356 if extrainf: 362 # example: do_package and do_package_write_ipk, so we need to
357 oe.path.remove(stfile + ".*" + extrainf) 363 # exactly match *.do_task.* and *.do_task_setscene.*
358 oe.path.remove(stfile + "_setscene" + ".*" + extrainf) 364 rm_stamp = '.do_%s.' % ss['task']
359 else: 365 rm_setscene = '.do_%s_setscene.' % ss['task']
360 oe.path.remove(stfile + ".*") 366 # For BB_SIGNATURE_HANDLER = "noop"
361 oe.path.remove(stfile + "_setscene" + ".*") 367 rm_nohash = ".do_%s" % ss['task']
368 for stfile in glob.glob(wildcard_stfile):
369 # Keep the sigdata
370 if ".sigdata." in stfile:
371 continue
372 if rm_stamp in stfile or rm_setscene in stfile or \
373 stfile.endswith(rm_nohash):
374 oe.path.remove(stfile)
362 375
363CLEANFUNCS += "sstate_cleanall" 376CLEANFUNCS += "sstate_cleanall"
364 377