mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
scripts/clean_functional_cache: tolerate missing .stamp files
Assets cached before the stamp files were introduced have no corresponding .stamp file. The script already copes with that when reading the timestamp, by assuming the QEMU v10.1 release date, which makes such assets eligible for removal. However, since commitc1bb594fe4, removing the asset also unconditionally unlinks its .stamp file. For these old entries that file does not exist, so unlink() raises FileNotFoundError and the script aborts after deleting the first such asset, leaving the rest of the cache uncleaned and returning an error. Pass missing_ok=True so that a missing .stamp file is not an error. Fixes:c1bb594fe4("scripts/clean_functional_cache: Remove also .stamp files") Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
This commit is contained in:
1 parent
eab716163b
commit
16dba888bd
1 file changed
+1
-1
@@ -44,4 +44,4 @@ for file in cache_dir.iterdir():
|
|||||||
print(f"Removing {cache_dir}/{file.name}.")
|
print(f"Removing {cache_dir}/{file.name}.")
|
||||||
file.chmod(stat.S_IWRITE)
|
file.chmod(stat.S_IWRITE)
|
||||||
file.unlink()
|
file.unlink()
|
||||||
stampfile.unlink()
|
stampfile.unlink(missing_ok=True)
|
||||||
Reference in new issue
Block a user