diff options
-rw-r--r-- | meta/classes/sstate.bbclass | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 8e8efd18d5..79588df2cd 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) |
@@ -1183,11 +1185,21 @@ python sstate_eventhandler_reachablestamps() { | |||
1183 | i = d.expand("${SSTATE_MANIFESTS}/index-" + a) | 1185 | i = d.expand("${SSTATE_MANIFESTS}/index-" + a) |
1184 | if not os.path.exists(i): | 1186 | if not os.path.exists(i): |
1185 | continue | 1187 | continue |
1188 | manseen = set() | ||
1189 | ignore = [] | ||
1186 | with open(i, "r") as f: | 1190 | with open(i, "r") as f: |
1187 | lines = f.readlines() | 1191 | lines = f.readlines() |
1188 | for l in lines: | 1192 | for l in reversed(lines): |
1189 | try: | 1193 | try: |
1190 | (stamp, manifest, workdir) = l.split() | 1194 | (stamp, manifest, workdir) = l.split() |
1195 | # The index may have multiple entries for the same manifest as the code above only appends | ||
1196 | # new entries and there may be an entry with matching manifest but differing version in stamp/workdir. | ||
1197 | # The last entry in the list is the valid one, any earlier entries with matching manifests | ||
1198 | # should be ignored. | ||
1199 | if manifest in manseen: | ||
1200 | ignore.append(l) | ||
1201 | continue | ||
1202 | manseen.add(manifest) | ||
1191 | if stamp not in stamps and stamp not in preservestamps and stamp in machineindex: | 1203 | if stamp not in stamps and stamp not in preservestamps and stamp in machineindex: |
1192 | toremove.append(l) | 1204 | toremove.append(l) |
1193 | if stamp not in seen: | 1205 | if stamp not in seen: |
@@ -1218,6 +1230,8 @@ python sstate_eventhandler_reachablestamps() { | |||
1218 | 1230 | ||
1219 | with open(i, "w") as f: | 1231 | with open(i, "w") as f: |
1220 | for l in lines: | 1232 | for l in lines: |
1233 | if l in ignore: | ||
1234 | continue | ||
1221 | f.write(l) | 1235 | f.write(l) |
1222 | machineindex |= set(stamps) | 1236 | machineindex |= set(stamps) |
1223 | with open(mi, "w") as f: | 1237 | with open(mi, "w") as f: |