summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6af0d388bc..2a54993d1d 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -1015,6 +1015,11 @@ python sstate_eventhandler2() {
1015 d = e.data 1015 d = e.data
1016 stamps = e.stamps.values() 1016 stamps = e.stamps.values()
1017 removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1") 1017 removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1")
1018 preservestampfile = d.expand('${SSTATE_MANIFESTS}/preserve-stamps')
1019 preservestamps = []
1020 if os.path.exists(preservestampfile):
1021 with open(preservestampfile, 'r') as f:
1022 preservestamps = f.readlines()
1018 seen = [] 1023 seen = []
1019 for a in d.getVar("SSTATE_ARCHS").split(): 1024 for a in d.getVar("SSTATE_ARCHS").split():
1020 toremove = [] 1025 toremove = []
@@ -1025,7 +1030,7 @@ python sstate_eventhandler2() {
1025 lines = f.readlines() 1030 lines = f.readlines()
1026 for l in lines: 1031 for l in lines:
1027 (stamp, manifest, workdir) = l.split() 1032 (stamp, manifest, workdir) = l.split()
1028 if stamp not in stamps: 1033 if stamp not in stamps and stamp not in preservestamps:
1029 toremove.append(l) 1034 toremove.append(l)
1030 if stamp not in seen: 1035 if stamp not in seen:
1031 bb.debug(2, "Stamp %s is not reachable, removing related manifests" % stamp) 1036 bb.debug(2, "Stamp %s is not reachable, removing related manifests" % stamp)
@@ -1047,4 +1052,6 @@ python sstate_eventhandler2() {
1047 with open(i, "w") as f: 1052 with open(i, "w") as f:
1048 for l in lines: 1053 for l in lines:
1049 f.write(l) 1054 f.write(l)
1055 if preservestamps:
1056 os.remove(preservestampfile)
1050} 1057}