forked from Mirror/pmbootstrap
Fix crash in "zap -a" and "zap -o" with apk3
With apkv3, APKINDEX files get deleted when running "apk cache clean". This is unexpected and needs to be investigated. Meanwhile run cache_clean() on the native arch last, as it needs the APKINDEX for the Alpine main repo of the native arch (even if cleaning other arches) in order to set up the chroot where we run "apk cache clean". This prevents crashing in "pmbootstrap zap -a" and "pmbootstrap zap -o". Related: BPO issue 160 Related: pmb issue 2627 Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2636
This commit is contained in:
parent
3d764546c1
commit
c9674c4455
1 changed files with 13 additions and 0 deletions
|
@ -182,8 +182,21 @@ def zap_pkgs_online_mismatch(confirm: bool = True, dry: bool = False) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Iterate over existing apk caches
|
# Iterate over existing apk caches
|
||||||
|
clean_native = False
|
||||||
for path in paths:
|
for path in paths:
|
||||||
arch = Arch.from_str(path.name.split("_", 2)[2])
|
arch = Arch.from_str(path.name.split("_", 2)[2])
|
||||||
|
|
||||||
if not dry:
|
if not dry:
|
||||||
|
if arch == Arch.native():
|
||||||
|
clean_native = True
|
||||||
|
continue
|
||||||
pmb.helpers.apk.cache_clean(arch)
|
pmb.helpers.apk.cache_clean(arch)
|
||||||
|
|
||||||
|
# pmb#2672: With apkv3, APKINDEX files get deleted when running "apk cache
|
||||||
|
# clean". This is unexpected and needs to be investigated. Meanwhile run
|
||||||
|
# cache_clean() on the native arch last, as it needs the APKINDEX for the
|
||||||
|
# Alpine main repo of the native arch (even if cleaning other arches) in
|
||||||
|
# order to set up the chroot where we run "apk cache clean". This prevents
|
||||||
|
# crashing in "pmbootstrap zap -a" and "pmbootstrap zap -o".
|
||||||
|
if clean_native and not dry:
|
||||||
|
pmb.helpers.apk.cache_clean(Arch.native())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue