Commit Graph

1800 Commits

Author SHA1 Message Date
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
Antoine Fontaine 350d384492
pmb.install._install: check sdcard exist (extra sanity check) (!1894) 2020-04-05 13:33:51 +02:00
Antoine Fontaine 00dc54a6c7
pmb.install._install: correct capitalisation in an error message (!1894) 2020-04-05 13:33:46 +02:00
Oliver Smith 73401f8606
pmb.parse.arguments: fix pkgname autocompletion (!1905)
Use pmb.helpers.args.add_cache() with the args used during
autocompletion, so pmb.helpers.pmaports._find_apkbuilds() does not fail
when trying to access args.cache.
2020-04-05 13:04:53 +02:00
Dolphin von Chips 364fb333f6
pmb.aportgen.linux: use _outdir for supporting out-of-tree kernel builds (!1893)
Require new pmaports version, which has the related devicepkg-dev
changes.
2020-04-05 12:54:09 +02:00
Dolphin von Chips cb9a02b348
build.menuconfig: add support for out-of-tree builds using _outdir (!1893) 2020-04-05 12:51:24 +02:00
Dolphin von Chips ff61dfc077
pmb.parse._apkbuild: handle _outdir in downstream kernels (!1893) 2020-04-05 12:51:19 +02:00
Oliver Smith b4a05cbcfb
pmb.build.is_necessary: fix case with Alpine's pkg (!1904)
No build is necessary if pmaport can't be built for given arch.
pmbootstrap must use Alpine's binary package in that case, even if the
pmaport version is higher than Alpine's binary package version.

Fixes: #1897
2020-04-04 13:19:03 +02:00
Oliver Smith 44cb06d345
pmb build --no-depends: stop on outdated pkgs too (!1900)
The --no-depends option is supposed to stop pmbootstrap if it was
instructed to build a package, but a dependency must be built first. So
far, this only covers the case if there is no binary package for a dependency.
Make it stop if the binary package exists, but is outdated, too.

Fixes: #1895
2020-04-01 09:22:35 +02:00
Minecrell 4e31ddcdd8
helpers/envkernel.sh: expand a glob to get path to deviceinfo (!1899)
The device might not be in testing, but in main or community,
so let's stop hardcoding testing here.
2020-04-01 02:50:13 +03:00
Minecrell b4c54636b3
test/testcases_fast.sh: stop hardcoding testing/ directory (!1899)
Take the change from pmaports that expands a glob for more flexibility.
2020-04-01 02:50:09 +03:00
Minecrell 37cc4454a4
pmb.config: make qemu-amd64 the default device (!1899)
At the moment we set samsung-i9100 as default device.
This is probably only for historical reasons.

For someone/something using pmbootstrap without a specific device in mind
(e.g. CI) it's really better to use a generic device. QEMU runs natively
in a virtual machine so everyone can use it for testing.
2020-04-01 02:50:04 +03:00
Minecrell 9249f36f16
pmb.helpers.pmaports: change some frequent messages to .verbose() (!1898) 2020-03-31 23:58:44 +02:00
Minecrell cd630edf25
pmb.helpers.pmaports: glob just once (!1898) 2020-03-31 23:58:38 +02:00
Oliver Smith 9d17ed29e3
pmb aportgen binutils: add texinfo to makedepends (!1901)
The current version of binutils does not build anymore without texinfo.

Related: #1894
Related: pmaports!1114
2020-03-31 23:33:41 +02:00
Daniele Debernardi 11c36fcf65
pmb.helpers.pmaports: cache get_list results (!1896) 2020-03-29 20:19:58 +02:00
Daniele Debernardi 20de238ff6
pmb.helpers.pmaports: search apkbuild path only if package exists (!1896) 2020-03-29 20:19:58 +02:00
Daniele Debernardi 0c179a5cf9
pmb.helpers.pmaports: cache _glob_apkbuilds results (!1896) 2020-03-29 20:19:48 +02:00
Luca Weiss f598a7fd41
pmb.parse._apkbuild: decrease log verbosity (!1897)
Closes #1886
2020-03-29 15:15:55 +02:00
Alexey Min 93514ae149
Fix "local variable '_partition_vbmeta' referenced before assignment" (!1895)
For safety, we should define variable in all code paths.

Fixes #1893
2020-03-23 04:37:13 +03:00
Alexey Min e5e48537b1
pmb.install: offer to flash vbmeta if device declares support for it (!1885) 2020-03-21 20:58:08 +01:00
Alexey Min e6da56d9b0
add "flasher flash_vbmeta" command (!1885)
Flashes device vbmeta partition (can be overriden with
"flash_fastboot_partition_vbmeta" setting in deviceinfo)
with custom vbmeta.img which has verity flag disabled,
so device can boot postmarketOS with no problems.
2020-03-21 20:58:08 +01:00
Daniele Debernardi 45f5ace1c2
pmb.helpers.frontend: fix wrong package name in kconfig check (!1891)
The kconfig check searches the aport with the "linux-" prefix to the
package name passed as argument. This is not working with the full
package name like linux-device-name because it searches a
linux-linux-device-name and fails.
2020-03-21 19:41:08 +01:00