meta: cache: rework cache clear (MR 2252)

This makes a looot more sense. Add a disable method too for use in
tests.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-13 05:57:38 +02:00 committed by Oliver Smith
parent 0365438134
commit 2cf44da301
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 11 additions and 33 deletions

View file

@ -47,7 +47,7 @@ def replace_apkbuild(args: PmbArgs, pkgname, key, new, in_quotes=False):
replace(path, "\n" + line_old + "\n", "\n" + line_new + "\n")
# Verify
Cache.clear_cache(pmb.parse.apkbuild)
pmb.parse.apkbuild.cache_clear()
apkbuild = pmb.parse.apkbuild(path)
if apkbuild[key] != str(new):
raise RuntimeError("Failed to set '{}' for pmaport '{}'. Make sure"