parse: apkindex: don't require python 3.12 (MR 2455)

Use a different way of keying the apkindex path cache.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-10-25 20:07:55 +02:00 committed by Oliver Smith
parent 2106e13f97
commit 12f9e43a08
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -5,7 +5,6 @@ from typing import cast, overload, Any, Literal
from collections.abc import Sequence
from pmb.core.apkindex_block import ApkindexBlock
from pmb.core.arch import Arch
from pmb.core.context import get_context
from pmb.helpers import logging
from pathlib import Path
import tarfile
@ -315,8 +314,9 @@ def parse_blocks(path: Path) -> list[ApkindexBlock]:
ret.append(block)
def cache_key(path: Path) -> str:
return str(path.relative_to(get_context().config.work, walk_up=True))
# FIXME: come up with something better here...
def cache_key(path: Path) -> int:
return hash(path)
def clear_cache(path: Path) -> bool: