diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sstate.bbclass | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index bcac3638e1..855f5a45a7 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -169,13 +169,18 @@ def sstate_clean_manifest(manifest, d): | |||
169 | for entry in entries: | 169 | for entry in entries: |
170 | entry = entry.strip() | 170 | entry = entry.strip() |
171 | bb.debug(2, "Removing manifest: %s" % entry) | 171 | bb.debug(2, "Removing manifest: %s" % entry) |
172 | if entry.endswith("/"): | 172 | # We can race against another package populating directories as we're removing them |
173 | if os.path.islink(entry[:-1]): | 173 | # so we ignore errors here. |
174 | os.remove(entry[:-1]) | 174 | try: |
175 | elif os.path.exists(entry) and len(os.listdir(entry)) == 0: | 175 | if entry.endswith("/"): |
176 | os.rmdir(entry[:-1]) | 176 | if os.path.islink(entry[:-1]): |
177 | else: | 177 | os.remove(entry[:-1]) |
178 | oe.path.remove(entry) | 178 | elif os.path.exists(entry) and len(os.listdir(entry)) == 0: |
179 | os.rmdir(entry[:-1]) | ||
180 | else: | ||
181 | oe.path.remove(entry) | ||
182 | except OSError: | ||
183 | pass | ||
179 | 184 | ||
180 | oe.path.remove(manifest) | 185 | oe.path.remove(manifest) |
181 | 186 | ||