-
- Downloads
chroot: apk: use apk.static in all cases
In 0b4fb911 (chroot: always run apk static v2 (MR 2423)) we adjusted install_run_apk() to run apk static on the host and pass in the local binary repo with "--repository". This function can call apk in two ways, either with the progress bar handling or without, the second case was never updated and still ran apk inside the chroot incorrectly and with an incorrect --repository flag. Let's finish the job by refactoring helpers/apk.py to support all our usecases and pointing everything to it, removing the last few situations where we call "pmb.chroot.root(["apk", ...]). The apk_with_progress() function is replaced by a generic "run()" function which takes a boolean to indicate if we should render apk progress. Additionally, a new cache_clean() function is added so that "pmbootstrap zap --pkgs-online-mismatch" can FINALLY be refactored to not rely on a chroot existing. This requires some hacks but nothing serious, see the comments in the function for details. The chroot.init() code is now simplified since handling the --root, --arch, and --cache-dir flags is now all done by apk._prepare_cmd(). Signed-off-by:Caleb Connolly <caleb@postmarketos.org>
Showing
- pmb/chroot/apk.py 6 additions, 15 deletionspmb/chroot/apk.py
- pmb/chroot/apk_static.py 4 additions, 3 deletionspmb/chroot/apk_static.py
- pmb/chroot/init.py 4 additions, 6 deletionspmb/chroot/init.py
- pmb/chroot/initfs_hooks.py 1 addition, 1 deletionpmb/chroot/initfs_hooks.py
- pmb/chroot/zap.py 2 additions, 14 deletionspmb/chroot/zap.py
- pmb/helpers/apk.py 111 additions, 12 deletionspmb/helpers/apk.py
Loading
Please register or sign in to comment