Commit Graph

1722 Commits

Author SHA1 Message Date
Oliver Smith 1f80472dda
helpers.git.get_upstream_remote: default to origin (MR 1940)
Do not crash in pmaports.git CI for merge requests where a different
repository was cloned as "origin". Fixes:

"ERROR: pmaports: could not find remote name for URL
 'https://gitlab.com/postmarketOS/pmaports.git' in git repository:
 /builds/plata-gl/pmaports"
2020-05-17 11:06:39 +02:00
Oliver Smith 7f60a6d782
chroot: put built packages into channel subdir (MR 1912)
Migrate to workdir version 5 and move already built packages into the edge
channel subdir, for example:
	$WORK/packages/x86_64/hello-world-1-r5.apk
to:
	$WORK/packages/edge/x86_64/hello-world-1-r5.apk

The build.postmarketos.org code has already been adjusted to find built
packages in either directory structure.
2020-05-17 08:08:45 +02:00
Daniele Debernardi d3dc3b2c98
pmb.chroot.shutdown: losetup with auto_init=False (MR 1912)
Do not go through the pmb.chroot.init() code path when running
pmb.install.losetup.umount() inside pmb.chroot.shutdown(). This is not
necessary, as pmb.install.losetup.umount() only gets called if the
chroot is already initialized and /dev/loop-control is mounted inside
the chroot.

Not going through this code path is important for the upcoming workdir
migration patch. Without this fix, it will fail with the following if
running "pmbootstrap install" before the work migration:

ERROR: Could not figure out on which release channel the 'native' chroot is
2020-05-17 08:08:45 +02:00
Oliver Smith 5a256f66de
pmb.helpers.pkgrel_bump.auto_apkindex_files: remove (MR 1912)
Replace the call to this function with the almost identical
pmb.helpers.repo.apkindex_files(), so release channel related changes
only need to be done in one place.
2020-05-17 08:08:45 +02:00
Oliver Smith 3ff0b18a08
pmb.chroot.init: verify chroot channel (MR 1912)
Refuse to work with a chroot that was created for another release
channel.
2020-05-17 08:08:45 +02:00
Oliver Smith ce433ae012
pmb.helpers.repo.urls: use channels.cfg mirrordirs (MR 1912)
Use mirrordir_pmos and mirrordir_alpine from channels.cfg to generate
the mirror URLs for postmarketOS and Alpine, which get written to
/etc/apk/repositories and which postmarketOS uses to download the
APKINDEX files.

Remove hardcoded "master" at the end of the postmarketOS mirror and use
mirrordir_pmos instead (which is "master" for the edge channel). Let the
postmarketOS mirror end in a '/' for consistency with the Alpine mirror
in pmb/config/__init__.py.

Remove obsolete --alpine-version. To experiment with a different Alpine
version, one should pass a custom --config-channels from now on.
2020-05-17 08:08:45 +02:00
Oliver Smith 2fb98adf92
pmb.helpers.repo.apkindex_files: deduplicate pmos urls (MR 1912)
Don't generate the postmarketOS mirror URLs here, let the urls()
function do it. A follow-up commit will touch this code, hence it's
important to have it de-duplicated.
2020-05-17 08:08:45 +02:00
Oliver Smith 6d64586b9f
test/test_repo.py: rename to test_helpers_repo.py (MR 1912)
This file is about testing pmb/helpers/repo.py, so make the name of the
test file consistent with other test/test_helpers_*.py files.
2020-05-17 08:08:45 +02:00
Oliver Smith 17f3b3c2f0
pmbootstrap init: ask for release channel (MR 1912)
Ask for release channel and switch pmaports branch to the related branch
defined in channels.cfg.

Store in pmbootstrap.cfg whether the user chose a channel (boolean). If
the user did not choose a channel yet, suggest the recommended channel
from channels.cfg (currently "edge").
2020-05-17 08:08:45 +02:00
Oliver Smith 261e8595ad
pmb.config.keys: sort / one entry per line (MR 1912)
Let's make this long list more git friendly.
2020-05-17 08:08:44 +02:00
Oliver Smith fc5cb2e190
pmb.config.pmaports: don't add to args (MR 1912)
Do not make the parsed pmaports.cfg from pmaports.git available as
args.pmaports anymore. This de-bloats the args variable a bit.

First I thought that we didn't even need to cache it, but it was pointed
out that later patches do access it frequently to read the current channel
from pmaports.cfg. Therefore it is using a cache now.

Related: #1879, #1855
2020-05-17 08:08:44 +02:00
Oliver Smith b015273d86
pmb/config/__init__.py: bump pmaports_min_version (MR 1912)
New pmaports.cfg has the "channel" key described in [1]. This will be
used in "pmbootstrap init" to determine on which release channel a
forked branch is.

[1] https://postmarketos.org/pmaports.cfg
2020-05-17 08:08:44 +02:00
Oliver Smith c616874443
pmb.helpers.git: parse channels.cfg (MR 1912)
Prepare to base postmarketOS on Alpine stable by parsing the new
channels.cfg file in pmaports.git, that describes which channel
needs which branches and mirror dirs from postmarketOS and Alpine.

Use the information in pmb.helpers.git.get_branches_official() first,
more is coming in follow-up commits.

Read the file from origin/master, so we get the latest fetched version
even if the last checked out master branch is not up-to-date (think of
currently checked out release branch instead of master, master will
never be updated to point to latest origin/master). Allow to override
the file with a new --config-channels parameter.

Related: https://postmarketos.org/channels.cfg
2020-05-17 08:08:44 +02:00
Oliver Smith ed16a9d080
pmb/parse/arguments.py: --config: add help text (MR 1912) 2020-05-17 08:08:39 +02:00
Oliver Smith 8f2bac8e63
Prepare 1.19.0 release 2020-05-10 18:41:16 +02:00
Dolphin von Chips 62f7a2af30
pmb.aportgen.linux: fix generated apkbuild when using qcdt (MR 1935) 2020-05-10 18:13:04 +02:00
Minecrell 0465f17e92
pmb.aportgen: Stop generating Maintainer: lines for device ports (MR 1932)
Most device ports that are added to pmaports (particularly the testing
category) are not actually "maintained". Many of them are never updated
after the initial contribution. There is little reason to list a
"Maintainer:" if the device package is actually not actively maintained
by that person.

Let's stop generating the Maintainer: line by default.
Instead, contributors should add the lines themselves if they are willing
to (actively) maintain the device package for a longer period of time.
Once they no longer want to maintain the package, the Maintainer:
line should be removed again.
2020-05-10 18:02:07 +02:00
Minecrell c33edea907
pmb.aportgen: Stop generating Contributor: lines for device ports (MR 1932)
The Git history is a much better representation of contributors
to a particular device port.
2020-05-10 18:02:02 +02:00
Oliver Smith f3466dcd3f
pmbootstrap lint: use CUSTOM_VALID_OPTIONS (MR 1934)
Let apkbuild-lint check options again, and pass the pmbootstrap specific
options with the new CUSTOM_VALID_OPTIONS variable. Add a test case and
adjust pmb.helpers.lint.check to return the output of apkbuild-lint, so
we can properly test it.

Related: https://gitlab.alpinelinux.org/Leo/atools/-/merge_requests/28
Fixes: pmaports#553
2020-05-10 16:35:35 +02:00
Martijn Braam df08af7984
arguments: --ccache-disable => --no-ccache (MR 1926)
Rename for consistency.
2020-05-10 16:18:10 +02:00
Anjandev Momi 44ab2f8c40
pmb.helpers.http.download respects --offline flag (MR 1930)
fixes #1837
2020-05-09 12:21:41 +02:00
Daniele Debernardi 9c2d951fc9
pmb.aportgen.device: replace mesa-dri-swrast with mesa-dri-gallium (MR 1917)
The `mesa-dri-swrast` package was merged into `mesa-dri-gallium` in Alpine.
(See 298e20d04f)

The old alias might be removed in the future, so change the generated APKBUILDs
to depend on `mesa-dri-gallium` instead.
2020-04-28 09:23:09 +02:00
Minecrell 9050010044
pmb.aportgen: strip trailing white space before splitting lines (MR 1924)
Many of the multi-line strings already contain a new line at the
end of the file. When using .split("\n") this will result in an empty
line at the end of the file that is again followed by a new line.

In other words: we have two new lines at the end, which looks weird.
.rstrip() the whitespace at the end of the string to avoid this.
2020-04-25 13:39:09 +03:00
Minecrell 2e9279ac21
pmb.aportgen: pkgname="..." -> pkgname=... (remove quotes) (MR 1924)
apkbuild-lint complains:
TP:[AL3]:APKBUILD:4:pkgname must not be quoted
2020-04-25 13:39:05 +03:00
Minecrell 2ca09cd21c
pmb.aportgen: convert to f-strings (MR 1924)
Finally it's readable again!
2020-04-25 13:38:58 +03:00
Oliver Smith 2f018c44ef
pmb.helpers.{package,pmaports,repo}: fix comments (MR 1928)
Make the comments on top of the three files less confusing and more
consistent.
2020-04-25 13:17:21 +03:00
Luca Weiss 4d2af94794
pmb.build.autodetect: support !pmb:crossdirect (MR 1922)
In case a package can't be built using crossdirect, add an APKBUILD
option to unconditionally disable crossdirect and use the slower
distcc approach instead. This is needed e.g. when using LD_PRELOAD during
the build as crossdirect cannot work with that.
2020-04-25 11:56:20 +02:00
Anjandev Momi 5bd6c59cea
Disable timeout for installing packages from apk (MR 1925)
closes #1748
2020-04-25 10:52:00 +03:00
Oliver Smith 14bb512861
pmbootstrap lint: use SKIP_INVALID_OPTION for now (MR 1927)
Don't verify APKBUILD options, so it doesn't complain about pmbootstrap
specific options. There's a merge request on the way for apkbuild-lint to
allow CUSTOM_VALID_OPTIONS in the future.

Related: https://gitlab.alpinelinux.org/Leo/atools/-/merge_requests/28
Related: https://gitlab.com/postmarketOS/pmaports/-/issues/553
2020-04-25 10:28:51 +03:00
Daniele Debernardi 37101a8035
pmb.install._install: fix subpartitions size calculation (MR 1915) 2020-04-20 03:19:30 +03:00
Minecrell be805653bb
helpers/envkernel.sh: Fix "Unable to deduce build architecture" (MR 1921)
After an abuild update in Alpine envkernel.sh now throws an error
when activating envkernel:

    ash: to: not found
    Run 'pmbootstrap log' for details.

This happens because functions.sh fails with:
    Unable to deduce build architecture. Install apk-tools, or set CBUILD.

For now it seems to be enough to set CBUILD appropriately to make it
work again.
2020-04-20 03:02:47 +03:00
Oliver Smith 77a6ad03cb
pmb.build.autodetect: support pmb:cross-native (MR 1920)
Have explicit selection of the "native" cross compilation method with a
new "pmb:cross-native" option. Deprecate the implicit pkgname pattern
matching.

Related: #1910
2020-04-19 13:33:14 +02:00
Daniele Debernardi 34c6f88691
pmb.install._install: add option to not generate the image (MR 1914) 2020-04-14 00:29:35 +03:00
Minecrell add39d1a57
pmb.config.init: fix perf regression when selecting "none" UI (MR 1913)
The ui-extras questions will attempt to find a postmarketos-ui-<ui>
package in pmaports. If the package does not exist as "root" APKBUILD
it currently attempts to parse all APKBUILDs in case it is somewhere
defined as a subpackage. This is really slow (up to 2-3 seconds),
which feels weird during "pmbootstrap init".

For the UI packages we specifically look for the root UI package,
not the subpackage, so let's skip searching for subpackages in this
case. This makes selecting the "none" UI nice and fast again.
2020-04-13 21:52:06 +03:00
Minecrell 87f81de052
test: test_questions_ui_extras: add tests for UI extras (!1911)
Ensure that it does not fail with the "none" UI (it does at the moment).
2020-04-11 20:57:01 +02:00
Minecrell 6731d02c4b
test: test_questions_ui: ensure that we can select "none" (!1911) 2020-04-11 20:57:01 +02:00
Minecrell 7f0898f1c5
test: test_questions_ui: use local aports (!1911)
This allows us to test the extras UI implementation without
modifying some packages in pmaports.
2020-04-11 20:57:01 +02:00
Minecrell 181687a2d7
test: test_qemu_running_processes: ensure "none" UI boots correctly (!1911)
No special process needs to be running, SSH is good already :)
2020-04-11 20:56:57 +02:00
Minecrell 4c31a610eb
pmb.config.init: fix error when selecting "none" UI (!1911)
The "none" UI does not have an APKBUILD, add must_exist=False
so pmaports.find() does not throw an error if the aport cannot be found.
2020-04-11 20:55:50 +02:00
Daniele Debernardi 43bf45bd02
pmb.config.init: prompt for installing UI extras package (!1906) 2020-04-11 19:10:45 +02:00
Oliver Smith 8dc8daa05a
test: adjust to device-qemu-amd64 move to main (!1910)
Don't assume that the device selected in "pmbootstrap init" is in the
testing subdir anymore. The default device, qemu-amd64, was recently
moved to main, so this does not hold up anymore. Instead, use
pmb.helpers.pmaports.find to figure out the currect dir.
2020-04-11 18:56:30 +02:00
Oliver Smith 44bd235f3e
test/test_build_package.py: fix new flake8 errors (!1910)
F540 f-string is missing placeholder

Apparently I like the new f-strings so much that I used them even where
they make no sense ;)
2020-04-11 18:56:25 +02:00
Iskren Chernev 41a7089e21
envkernel.sh: various improvements (!1883)
* Change prompt
* Add deactivate
* Use /tmp/envkernel for run-scripts
2020-04-10 20:28:08 +02:00
Oliver Smith b18ec9a693
pmb.helpers.package.get: no crash if dep missing (!1909)
Fix the function, so it does not crash anymore when the
replace_subpkgnames argument is set and a dependency cannot be resolved.
Instead, print a useful warning that shows which pmaport caused the
error (that has always been a pain to figure out), and simply don't
replace the potential subpkgname with the real pkgname, just use the
dependency name as-is.

Resolve annoying crashes in bpo dependency resolving, like this one
(caused by a few linux-* pmaports for bad downstream kernels that depend
on python, not apparent at all from the message):

[09:08:15] Calculate packages that need to be built (all packages, aarch64)
[09:08:26] ERROR: Package 'python': Could not find aport, and could not find this package in any APKINDEX!

Related: https://builds.sr.ht/~postmarketos/job/184022
2020-04-10 19:34:09 +02:00
Niklas Cathor 29a3cb2b8c
pmb.helpers.frontend.config: add option to reset config to default (!1907) 2020-04-07 01:02:19 +03:00
Niklas Cathor 00a4eaf91d
pmb.helpers.frontend.config: add support for clearing a config value (!1907)
Previously these two commands would both print the current value:
  pmbootstrap config extra_packages
  pmbootstrap config extra_packages ''

With this change, the second command will instead set the given config
value to the empty string.
2020-04-07 01:02:12 +03:00
Oliver Smith 098eb4710e
Prepare 1.18.1 release 2020-04-06 16:49:45 +02:00
Oliver Smith 59272236ad
pmbootstrap pull: skip pmaports version check (!1908)
Prevent "pmbootstrap pull" from failing with:

NOTE: your pmaports folder has version 4, but version 6 is required.
ERROR: Run 'pmbootstrap pull' to update your pmaports.

Fixes: #1900
2020-04-06 16:34:22 +02:00
Luca Weiss 20e6dd0085 pmb.aportgen.linux: fix generated apkbuild 2020-04-06 10:39:45 +00:00
Oliver Smith 73ac84f605
Prepare 1.18.0 release 2020-04-05 13:47:31 +02:00