Commit 37ec73c dropped the use of args to access command line arguments,
but did not add another way to pass command line arguments; thus,
optional flags to flash_kernel, flash_rootfs, flash_lk2nd, sideload and
list_devices were ignored.
Fix this by making sure the relevant arguments are passed for all
frontend methods.
Fixes#2522.
Without this, `$ pmbootstrap init` crashes if a nonexistent UI package
is selected. This can happen if one previously selected a UI package in
a former checkout of pmaports, but then switched away to a different one
that doesn't have the UI package. For example, if someone is working on
a new UI in a feature branch and then switches away from it, or if a UI
is removed from the canonical pmaports repository altogether.
pmbootstrap install --android-recovery-zip always failed with:
ERROR: The recovery zip has not been generated yet, please run
'pmbootstrap install' with the '--android-recovery-zip' parameter first!
I debugged it with a simple print statement of the full path and saw
a repetition of the first part of the path. I discovered that the
mountpoint is "/mnt/" + chroot, so adding chroot again leads to a
repetition of the first part of the path and to a non-existent location.
Closes: issue 2441
The unpacking operator can unpack any iterable of any type, unlike the +
operator which only works on some sequences and requires them to be of
the same type usually. Using it allows us to get rid of the line that
disables the "operator" error code for this function.
These seem pretty useful to me. I ignored RUF021 since it seems a bit
silly to me and I didn't see the point in fixing the one violation of it
that we have in the code, but if you're reading this in the future and
want to do so be my guest, I don't really care either way.
Merge strings that have a break in the same line. These were generated
when running "ruff format" initially.
Old:
logging.info("Firewall is not supported in checked out pmaports" " branch.")
New:
logging.info("Firewall is not supported in checked out pmaports branch.")
Signed-off-by: Robert Eckelmann <longnoserob@postmarketos.org>
Tweaked-by: Oliver Smith <ollieparanoid@postmarketos.org>
Now that systemd was merged into master, it is extra-repos/systemd
instead of staging/systemd.
As of writing, the repository is not published yet but this will happen
soon.
Related: https://postmarketos.org/edge/2025/01/09/systemd-soon/
Fix that repo_missing would pick the wrong package information if a
package is in both the normal repository and the split repository.
This would lead to having the wrong version and depends:
"pkgname": "gnome-shell-mobile",
"repo": null, # not in the systemd repo
"version": "99946.1-r1",
"depends": [
Instead of the correct version:
"pkgname": "gnome-shell-mobile",
"repo": null, # not in the systemd repo
"version": "46.1-r1",
"depends": [
Fix this by calling pmb.parse.apkbuild() directly with the APKBUILD path
when iterating over the APKBUILDs, instead of pmb.helpers.package.get().
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.