Fix that abuild gets added twice in packages that exist in both the main
and split systemd repository:
"pkgname": "gnome-settings-daemon-mobile",
"repo": null,
"version": "99946.0-r0",
"depends": [
"abuild",
"abuild",
"alsa-lib-dev",
"colord-dev",
This fixes the following error in bpo when it tries to use the output of
"pmbootstrap repo_missing":
UNIQUE constraint failed: package_dependency.package_id, package_dependency.dependency_id
Related: https://postmarketos.org/edge/2025/01/09/systemd-soon/
In the systemd repository, we currently have a forked version of
abuild, which needs to be used to build all other packages. Check if we
have a forked abuild, and if it is the case, add it to the dependencies
of all other packages.
Closes: issue 2401
The "pmbootstrap repo_missing" action is used exclusively by bpo. It
calls it only with these arguments:
pmbootstrap repo_missing --built --arch "$ARCH"
A blocker for merging systemd into pmaports master is, that the
current repo_missing code cannot display packages that are both in
extra-repos/systemd and in another path. I have considered just not
supporting this and discussed doing that with Caleb and Clayton, but we
figured it would be a major obstacle in the future to not be able to
easily override packages with systemd specific versions (currently we
need this for 3 packages).
Integrating this into the existing repo_missing code would be hacks upon
hacks. Also the scope of the current repo_missing code has many extra
features that are not used and would be extra effort to carry along:
* Allow specifying a pkgname
* Running without --built
* --overview
So I decided to replace the repo_missing code with a much simpler, more
modern implementation, that does exactly what is needed:
* Duplicate packages in systemd and non-systemd dirs are displayed
* The output always include all packages, no matter if they are already
built or not (same behavior as with --built)
* Removed --overview and selecting specific packages too
* The code for filling "repo" (either "systemd" or None) is more
resilient now, as it can use proper relative paths to the root of
pmaports. Unlike the previous implementation, it will not fail if
subdirs are added to the systemd dir.
I have made sure that the output is exactly the same as before on
current pmaports master.
Related: bpo issue 144
Related: bpo issue 140
This lints copyright headers to ensure we don't forget them.
Unfortunately, it is only available in Ruff preview right now, so the
following commit will enable that for the Ruff CI check. However, this
could be reverted in the future once this check makes it into Ruff "not
preview".
Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2526
I tried my best to get the right author based on git commit history, but
in the case of code being moved from one file to make another I might
have gotten something wrong.
As of 139c205424, we ignore F401 in
__init__.py through the pyproject.toml configuration file, so we don't
need to treat it differently here in the CI script too.
Hopefully makes for easier to read code, and potentially also faster
once we have mypyc and the enum can get compiled into plain integers
instead of the strings we previously were working with.
For some reason this also requires a fix in pmb.install._install.py,
didn't bother investigating why but the necessary change seems fine to
me.
Requires mypy 1.14 (maybe 1.14.1, not sure).
Presumably, args and kwargs are just here to retain compatibility with
add_argument() from argparse.ArgumentParser, but they aren't actually
used and consequently only give the illusion of compatibility. Just
remove them to simplify the function signature.
Previously, value would sometimes be a string despite the docstring
clearly stating that it should be an integer. This seems to have been a
consequence of literally copying the original C code without considering
that strings work differently between the languages, where the
original assigning a character in a string to an integer results in the
integer having the ASCII value of that character, in Python you just get
the string value of that character. As such, match the original
implementation by explicitly converting from a string to an integer
using ord(), which gives the Unicode code of the provided character.
It is not clear to me why this disparity didn't cause any issues beyond
type errors found by mypy.
See 5d796b5678/src/version.c (L101)
The file version.c in modern apk-tools does not at all resemble this
file. Link to one from around the time when this code was written to
make cross-referencing easier.
Also, switch from cgit to GitLab because I couldn't be bothered to
figure out how to go through file revisions on cgit.
This might have saved me a couple of minutes of debugging, at least.
While working with the aportgen code I had two distinct issues:
1. APKINDEX was outdated, so I got an error about not being able to
download the supposedly latest version of BusyBox as it no longer
existed on Alpine's mirror.
2. APKINDEX had not been created by any other command, so aportgen
would tell me that it couldn't find the "busybox" package.
The changes in this commit resolves both of these issues from my
testing.
These were almost identical across the Busybox, GRUB EFI, and musl
generators. Unify them by creating functions they all (and any future
aportgen generators) can call instead of having to maintain three
separate copies of this code.
When lk2nd is a dependency of a device subpackage (e.g. a mainline
kernel subpackage), it is not detected.
If no lk2nd pacakge is found, also parse the dependencies of all
subpackages.
Signed-off-by: Alexandre Messier <alex@me.ssier.org>
pmb.helpers.cli.ask() returns a string, so previously this function was
just lying about its return type (which happened to be fine in the
context it was used, but still not what we want).
pmb.helpers.cli.ask() takes a string and only work with Path by
accident, so explicitly convert <default> to a string if it is not None.
Additionally, while this function claimed to return a Path, it actually
returned a string, so fix that too.
Otherwise mypy gets confused by the type later in the code, and I also
think it might be confusing behaviour in general that <options> gets
overwritten in this loop.
The parameters of this function were needlessly complicated. While I
understand the intent of trying to replicate the API of retrieve()
without duplicating the parameter list, in practice this feels like
reducing duplication to a fault to me. This is due to that the third
parameter, <allow_404>, doesn't make sense in the context of
retrieve_json() as it would raise an exception[1] if retrieve() returns
None (which is the effect of <allow_404> when a 404 occurs), thus merely
changing the exception that gets raised to a less descriptive one
instead of actually behaving like retrieve() would with that parameter
set to True.
With <allow_404> eliminated, there's just two parameters left, and I
don't think duplicating those is a big deal. So make the function easier
to read and annotate by getting rid of the args/kwargs logic.
[1]: json.loads() raises an exception if its first argument is None
Devices using fastboot-bootpart typically boot directly from the boot file
system. They might still support "fastboot boot" though, which can be used
to boot a modified kernel more easily. Enable this similar to the existing
"flash_boot" action.
Prepare a new release, so pmbotostrap can be used with Alpine 3.21 /
postmarketOS v24.12. Also the big rewrite is done, so we can do more
frequent releases again.
Related: https://wiki.postmarketos.org/wiki/Pmbootstrap_release
Add module that provides utilities and information related to localization.
Initial implementation includes code to generate keyboard configs
for locale set by user.