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 commit c1bb594fe4, 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:
Brian Cain committed 2026-10-27 07:23:27 -07:00
1 parent eab716163b
commit 16dba888bd
1 file changed
+1 -1
+1 -1
View File
@@ -44,4 +44,4 @@ for file in cache_dir.iterdir():
print(f"Removing {cache_dir}/{file.name}.")
file.chmod(stat.S_IWRITE)
file.unlink()
stampfile.unlink()
stampfile.unlink(missing_ok=True)