summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/sstate.bbclass16
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a8e169a10b..3c89c35ecf 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -319,6 +319,8 @@ def sstate_install(ss, d):
319 if os.path.exists(i): 319 if os.path.exists(i):
320 with open(i, "r") as f: 320 with open(i, "r") as f:
321 manifests = f.readlines() 321 manifests = f.readlines()
322 # We append new entries, we don't remove older entries which may have the same
323 # manifest name but different versions from stamp/workdir. See below.
322 if filedata not in manifests: 324 if filedata not in manifests:
323 with open(i, "a+") as f: 325 with open(i, "a+") as f:
324 f.write(filedata) 326 f.write(filedata)
@@ -1175,11 +1177,21 @@ python sstate_eventhandler2() {
1175 i = d.expand("${SSTATE_MANIFESTS}/index-" + a) 1177 i = d.expand("${SSTATE_MANIFESTS}/index-" + a)
1176 if not os.path.exists(i): 1178 if not os.path.exists(i):
1177 continue 1179 continue
1180 manseen = set()
1181 ignore = []
1178 with open(i, "r") as f: 1182 with open(i, "r") as f:
1179 lines = f.readlines() 1183 lines = f.readlines()
1180 for l in lines: 1184 for l in reversed(lines):
1181 try: 1185 try:
1182 (stamp, manifest, workdir) = l.split() 1186 (stamp, manifest, workdir) = l.split()
1187 # The index may have multiple entries for the same manifest as the code above only appends
1188 # new entries and there may be an entry with matching manifest but differing version in stamp/workdir.
1189 # The last entry in the list is the valid one, any earlier entries with matching manifests
1190 # should be ignored.
1191 if manifest in manseen:
1192 ignore.append(l)
1193 continue
1194 manseen.add(manifest)
1183 if stamp not in stamps and stamp not in preservestamps and stamp in machineindex: 1195 if stamp not in stamps and stamp not in preservestamps and stamp in machineindex:
1184 toremove.append(l) 1196 toremove.append(l)
1185 if stamp not in seen: 1197 if stamp not in seen:
@@ -1210,6 +1222,8 @@ python sstate_eventhandler2() {
1210 1222
1211 with open(i, "w") as f: 1223 with open(i, "w") as f:
1212 for l in lines: 1224 for l in lines:
1225 if l in ignore:
1226 continue
1213 f.write(l) 1227 f.write(l)
1214 machineindex |= set(stamps) 1228 machineindex |= set(stamps)
1215 with open(mi, "w") as f: 1229 with open(mi, "w") as f: