forked from Mirror/pmbootstrap
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:
parent
2106e13f97
commit
12f9e43a08
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,6 @@ from typing import cast, overload, Any, Literal
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from pmb.core.apkindex_block import ApkindexBlock
|
from pmb.core.apkindex_block import ApkindexBlock
|
||||||
from pmb.core.arch import Arch
|
from pmb.core.arch import Arch
|
||||||
from pmb.core.context import get_context
|
|
||||||
from pmb.helpers import logging
|
from pmb.helpers import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import tarfile
|
import tarfile
|
||||||
|
@ -315,8 +314,9 @@ def parse_blocks(path: Path) -> list[ApkindexBlock]:
|
||||||
ret.append(block)
|
ret.append(block)
|
||||||
|
|
||||||
|
|
||||||
def cache_key(path: Path) -> str:
|
# FIXME: come up with something better here...
|
||||||
return str(path.relative_to(get_context().config.work, walk_up=True))
|
def cache_key(path: Path) -> int:
|
||||||
|
return hash(path)
|
||||||
|
|
||||||
|
|
||||||
def clear_cache(path: Path) -> bool:
|
def clear_cache(path: Path) -> bool:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue