Commits on Source (16)
-
Caleb Connolly authored
Make intellisense happy Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
make mypy happy Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Lazy load pmb.config.styles and move the pmb.__version__ print elsewhere so the logging module is (closer to) a standalone entity. This is necessary to be able to import it in pmb/helpers/apk.py otherwise we get a cyclical dependency. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
This function better belongs here, especially as it will be used outside of the context of a chroot() soon. Additionally, it's adjusted to take the rootfs path as its first argument rather than a chroot, since it could operate on any rootfs. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
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, --cache-dir, and --repository flags is now all done by apk._prepare_cmd() as and when appropriate. Lastly, this fixes a (previously unnoticed) bug where apk.static was actually using /var/cache/apk on your host machine for its cache... This is definitely not good behaviour.... Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Since all apk invocations withing pmbootstrap now use apk.static by default, apk_static.run() isn't called anymore, so let's remove it. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Move the apk_static module from pmb/chroot to pmb/helpers which is a more suitable location. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Since parse.deviceinfo() returns a custom class now, it can't be trivially serialized as JSON. This has been broken for months now so it's clear nobody is using this. Let's take the chance to get rid of it. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
When running "apk add" we must always have --cache-dir set! We also expect --no-interactive to be set. Add some asserts so we don't regress here. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
This was always a hack, and it looks like there (hopefully) aren't any placs where we still need to handle this. Possibly expecting regressions... But then we have something to write a test for. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
When pmbootstrap starts up, it loads the config file (or uses the defaults) and then merged some arguments (e.g. --work) into it. However in config.init.frontend() we were creating yet another new Config, but it's too late to merge args in at this point... Rework this slightly to fix that major oversight and remove the totally unnecessary hack of calling pmb.config.load() again. This fixes calling pmbootstrap init with --work Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
There was an oversight when this API was originally created and it implicitly assumed that the pmaports repository was always named "pmaports". This unfortunately broke some peoples workflows. Introduce a new "pkgrepo_name()" function and adjust the codebase to use it, as well as adjusting pkgrepo internally to special case the "pmaports" repo so that it's always named pmaports no matter what the directory itself is named. This is probably more complexity than we should be dealing with here, we should probably create a new type to encode this behaviour. Fixes: #2412 Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
We shouldn't overwrite config.aports if the user specified a custom --aports directory. We only want to do this to update the default if they're using a custom workdir. Make the code here less aggressive, and correctly use the last entry in config.aports as "pmaports" instead of the first. Fixes: #2386 Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Use Alpine 3.17 to test pmbootstrap with older versions of Python Fixes: #2477 Suggested-by:
Oliver Smith <ollieparanoid@postmarketos.org> Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
You can't check enum membership with __contains__() on Python 3.10, poke inside the enum instead. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Oliver Smith authored
pmbootstrap requires "tomli" if running with python < 3.11, so install it.
Showing
- .gitlab-ci.yml 12 additions, 0 deletions.gitlab-ci.yml
- docs/api/pmb.chroot.rst 0 additions, 8 deletionsdocs/api/pmb.chroot.rst
- docs/api/pmb.helpers.rst 8 additions, 0 deletionsdocs/api/pmb.helpers.rst
- pmb/__init__.py 0 additions, 1 deletionpmb/__init__.py
- pmb/aportgen/busybox_static.py 0 additions, 1 deletionpmb/aportgen/busybox_static.py
- pmb/aportgen/grub_efi.py 0 additions, 1 deletionpmb/aportgen/grub_efi.py
- pmb/aportgen/musl.py 0 additions, 1 deletionpmb/aportgen/musl.py
- pmb/build/backend.py 3 additions, 3 deletionspmb/build/backend.py
- pmb/chroot/apk.py 6 additions, 68 deletionspmb/chroot/apk.py
- pmb/chroot/init.py 9 additions, 13 deletionspmb/chroot/init.py
- pmb/chroot/initfs_hooks.py 1 addition, 1 deletionpmb/chroot/initfs_hooks.py
- pmb/chroot/zap.py 4 additions, 15 deletionspmb/chroot/zap.py
- pmb/commands/__init__.py 0 additions, 1 deletionpmb/commands/__init__.py
- pmb/commands/repo_bootstrap.py 6 additions, 6 deletionspmb/commands/repo_bootstrap.py
- pmb/config/__init__.py 1 addition, 0 deletionspmb/config/__init__.py
- pmb/config/init.py 9 additions, 11 deletionspmb/config/init.py
- pmb/config/pmaports.py 7 additions, 2 deletionspmb/config/pmaports.py
- pmb/core/chroot.py 1 addition, 1 deletionpmb/core/chroot.py
- pmb/core/pkgrepo.py 26 additions, 5 deletionspmb/core/pkgrepo.py
- pmb/helpers/apk.py 192 additions, 12 deletionspmb/helpers/apk.py