Skip to content

Support arch="" in APKBUILD to skip builds

Oliver Smith requested to merge support-empty-arch-field into master

Three patches:

menuconfig: don't require --arch to match APKBUILD

Do not verify that the architecture passed with --arch is part of the
arch variable in APKBUILD. This prepares to set 'arch=""' to temporarily
disable building packages. Users will still be able to run "pmbootstrap
menuconfig" on them by manually specifying the architecture.
menuconfig: refactor get_arch()

Simplify the logic by not even calling get_arch() if args.arch is set.
Support arch="" in APKBUILD to skip builds

Alpine indicates with arch="", that a package should temporarily not be
built for any architecture. Support this in postmarketOS too by not
complaining in the APKBUILD parser if arch is empty.

Adjust pmb.build.autodetect.arch and pmb.build.menuconfig.get_arch, so
both don't fail with an IndexError when encountering a disabled package.

Co-Authored-By: z3ntu

How to test:

  • set arch="" in a kernel APKBUILD
  • run pmbootstrap repo_missing on both pmbootstrap master and this MR, the "Arch must not be empty" error should be gone
  • run pmbootstrap kconfig edit on the kernel
  • run pmbootstrap build on the kernel, note that there is no IndexError, but instead a useful error message

I ran the bpo testsuite against the patches from this MR with success.

Closes: #1954 (closed)

Merge request reports