Python 3.10.12 fails without this patch:
File "/media/gompa/73d88639-a730-456c-a428-6d500b4020b7/pmbootstrap/pmb/parse/arguments.py", line 844 help="Alpine Linux mirror, default: " f"{default_config.mirrors["alpine"]}",
SyntaxError: f-string: unmatched '['
Related: https://peps.python.org/pep-0701/
(Commit message written by Oliver)
Instead of
[PosixPath('/home/newbyte/.local/var/pmbootstrap/cache_git/pmaports')]
you get
/home/neboula/.local/var/pmbootstrap/cache_git/pmaports
like before.
Fixes envkernel.sh failing during activation.
Closes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2378
Otherwise pmbootstrap can't run these a few lines later. I don't know
how this worked before, but this makes $ pmbootstrap kconfig migrate
function again.
crosscompile() in autodetect.py expects <arch> to be an Arch type
instead of a str, which is also probably what we want to move the entire
codebase towards. As such, let's convert this string into an Arch here.
This is currently broken, and I'm about to rewrite a lot of related
code. Just don't run the check for now, we can bring this back
afterwards if we want to.
These are based on the originally from pyupgrade. They replace older
syntax with newer (and more concise) syntax. Some of the replaced syntax
is deprecated.
There are no violations of this lint any more. This lint only checks
that an import is the beginning of a block; it will not be a problem if
a test needs to include an import.
A bare except catches things like ctrl+c (KeyboardInterrupt). If don't
want to catch this exception. Remove the bare except and restore the
default lint.
Python 3.9 was required in pmb/__init__.py already, but some references
still said 3.8 and 3.7.
Co-Developed-By: Oliver Smith <ollieparanoid@postmarketos.org>
We recently changed how we manage chroots, requiring the user (of the
chroot) to initialize it before doing stuff like installing packages.
There are however still certain edgecases in pmbootstrap where this
doesn't get done (for example qemu/run.py would attempt to install the
kernel package for the device, but we don't initialize the rootfs chroot
in QEMU since that doesn't make sense to do). Check for and catch this
situation explicitly so we don't ruin someones day, but still be loud
about it so we can hopefully catch the remaining instances of this.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Fix for:
$ pmbootstrap pull
[21:09:43] aports_upstream (branch: 3.20-stable): not on one of the official branches (master), skipping pull!
Replace the get_branches_official() function that according to git log
was never able to tell if an aports branch was official. The new
function branch_looks_official() can do that by just checking if the
branch follows the typical naming pattern.
The comment I had put into get_branches_official earlier was not true
anymore, by now this did not only get used by "pmbootstrap status", but
also by "pmbootstrap pull".
Let pmbootstrap display 3.0.0_alpha on crash, so it's clear when people
are using the new codebase.
Before you report this error, ensure that pmbootstrap is up to date.
Find the latest version here: https://gitlab.com/postmarketOS/pmbootstrap/-/tags
Your version: 3.0.0_alpha
This turns out to have been wrong, since we need to give apk the package
name AND the apk file, it installs the apk and then uninstalls it but
leaves the package installed by name.
Don't try and install random packages in the rootfs chroot when starting
QEMU. The chroot is not initialised and this just adds latency.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
One flaw of pathlib is that Path("/tmp/") / "/some/relative/path"
results in Path("/some/relative/path")....
Fix the places in the codebase where we get this wrong.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Turns out this is necessary, *sigh*. Since we could have one locally
built package depend on another locally built package.
So yeah, re-implement this, but in a slightly lazier / hopefully faster
way.
Bah
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>