helpers: file: fix apkbuild cache clear (MR 2252)

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-13 02:07:19 +02:00 committed by Oliver Smith
parent f186ee8498
commit 0970b9d00b
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -5,6 +5,7 @@ import os
from pathlib import Path
import time
from pmb.meta import Cache
from pmb.types import PmbArgs
import pmb.helpers.run
import pmb.helpers.pmaports
@ -46,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
del (pmb.helpers.other.cache["apkbuild"][path])
Cache.clear_cache(pmb.parse.apkbuild)
apkbuild = pmb.parse.apkbuild(path)
if apkbuild[key] != str(new):
raise RuntimeError("Failed to set '{}' for pmaport '{}'. Make sure"