Commit Graph

141 Commits

Author SHA1 Message Date
Natanael Copa 7e7b0a5ba3 tests: increase timeout for abuild-fetch to call curl
The CI may be under load.
2024-04-17 08:40:47 +02:00
Natanael Copa 645c3c07a7 abuild: exclude provides for commans with @
the '@' characted serves as a repository separator (eg. pkg@repo) so we
should not add a cmd: provides for binaries having this character.

This avoids conflicts with for example `who` from coreutils and `who@`
from ucspi-tpc6.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10074
2024-04-17 08:35:27 +02:00
Natanael Copa e4896c01b8 test: inline bin-in-path APKBUILD
Improves readability. No functional changes
2024-04-17 08:21:40 +02:00
Sertonix 20b1f47c63 abuild: fix ~ splitting pkgname and pkgver 2024-04-12 11:51:48 +00:00
Sertonix 1804361f61 abuild: error on digit+letter+digit version format 2024-03-29 11:12:51 +00:00
Sertonix a9053617db abuild: stricter pkgname check 2024-03-28 22:40:14 +00:00
Sertonix 73cc75b3e0 abuild: amove: allow spaces in pattern 2024-03-28 18:40:25 +00:00
Timo Teräs ec11f495cd abuild: add an option to keep all directories
This is mainly needed for alpine-baselayout which creates all
directories, and most of them are empty. The code in question
would remove directories we explicitly want alpine-baselayout
to create and own.
2024-03-22 21:56:14 +02:00
Natanael Copa 8da2501613 abuild: warn for more version suffixes
give a warning when version suffix a<digit>/b<digit> probably should be
_alpha<digit>/_beta<digit>.

ref: https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10972#note_380899
2024-03-13 11:57:50 +01:00
Sertonix 4ae1b39910 abuild: fix quote handling in check_license 2024-02-12 12:39:17 +01:00
Sertonix cd32e245e2 abuild: fix subpackage setting arch to all explicitly 2024-01-12 18:28:09 +01:00
Natanael Copa fab41364f7 checkapk: dont require abuild.conf if we have default conf
also add tests
2023-10-18 11:22:47 +02:00
Natanael Copa 643637dd5d checkapk: add test, fix usage
print --help output to stdout and errors to stderr.
2023-10-18 11:07:24 +02:00
Natanael Copa 3a7fdeaaf0 tests: speed up abuild cleanoldpkg test
skip various steps when buliding the package.
2023-10-18 08:46:09 +02:00
Natanael Copa 08126de5f2 tests: add another test for abuild deps
Test that passing only `CHOST=... abuild deps` works as expected
2023-10-17 22:30:00 +02:00
Natanael Copa c73b8f4ca7 tests: test checkdepends
verify that checkdepends is pulled in when it should and not installed
when it shouldn't.
2023-10-17 22:04:56 +02:00
Natanael Copa 852bb238f3 tests: add test for abuild dep
verify that makedepends_build and makedepends_host works as expected.
2023-10-17 19:51:35 +00:00
psykose 446b68359f tests: make sure move_caches tests don't fail with envs set 2023-06-26 10:33:40 +02:00
Jakub Panek c26043748e abuild: fix completions to vendor dir, warn on incorrect dir
Signed-off-by: Jakub Panek <me@panekj.dev>
2023-06-22 04:08:05 +00:00
ptrcnull d27b635768 abuild: set cache directories to a temporary directory if MOVE_CACHES is set
this allows for isolating cache directories per package
2023-06-22 05:33:59 +02:00
psykose 8f41a924e3 abuild: fix cmd: provides to not provide directory names
/usr/bin/somedirectory/ was providing cmd:somedirectory, because dirs
have +x.
2023-06-15 14:37:24 +02:00
Sören Tempel 4a2a0337d0 abuild: Scan for binaries with extra setcap(8) capabilities
Similar to suid binaries, abuild will now error out if the package
includes binaries with setcap(8) capabilities but doesn't have `setcap`
in `$options`. This eases identifying package which ship binaries
with extra capabilities.

Furthermore, if these binaries are executable by others a warning is
emitted. This warning could be changed to an error in the future.
The recommendation is to make such binaries only executable by owner
and group, thereby requiring the system administrator to explicitly
add users to a specific group in order to give them accesses to these
capabilities.

See: https://gitlab.alpinelinux.org/alpine/tsc/-/issues/45

Discussion: This change requires abuild to depend on the `libcap`
package for the `getcap` binary. It does not seem to be possible
at the moment to use scanelf(1) to identify these binaries.
2022-07-03 14:30:15 +02:00
Sören Tempel e2ab6219d3 abuild: Warn if -doc subpackage exceeds a certain threshold
In the warning, suggest splitting the -doc subpackage into additional
smaller packages (which are not pulled in by the `docs` meta package).

Fixes https://gitlab.alpinelinux.org/alpine/tsc/-/issues/16
2023-06-03 10:55:12 +00:00
Natanael Copa f2978eb33f abuild-keygen: add support for creating kernel signing key
We need to have a key that can be used to sign kernel modules and
specifically 3rd party kernel modules. Add support for creating this key
in abuild-keygen.

ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/14873
2023-05-05 13:39:47 +02:00
Natanael Copa 0daf4ae637 tests: unset CFLAGS
CFLAGS may be set in the running environment (eg in abuild check)
2023-04-18 15:53:11 +02:00
Natanael Copa b24bc33446 abuild: warn if pycache is found
and add tests for -pyc package split
2023-04-18 13:27:51 +00:00
Natanael Copa a1b672cad2 functions: read default configs from /usr/share/abuild/default.conf
This makes it easier to push default config updates with apk
2023-04-18 13:26:49 +02:00
Natanael Copa fe26e9483b functions: add test for environment preference 2023-04-18 13:15:38 +02:00
Marian Buschsieweke 6806a0d39b abuild: scan for python3 version requirements
Packages installing python3 site packages for python3 in version 3.x.y
depend on python3~3.x. This automatically adds the required
dependencies.

Unit test cases have been added by reusing the `py3-foo-and-bar` test
package. However, the path of that has been renamed to contain spaces
to be extra sure the logic is safe in regrade to spaces in path
names.
2023-04-18 09:26:12 +00:00
psykose af88d534d3 Revert "abuild: prune python cache dirs by default"
This reverts commit 489fc06e40.

this needs way more thought to work, see
32f314f8076d509bd4c541b1d250b3744947867f in aports

we should probably just create *-pyc splits instead. these
won't reduce mirror size, but at least allow easily uninstalling the cache.
2023-04-14 16:31:54 +02:00
psykose 489fc06e40 abuild: prune python cache dirs by default
these will be generated post-install in a hook.

ref https://gitlab.alpinelinux.org/alpine/aports/-/issues/11906
2023-04-14 08:56:48 +00:00
Natanael Copa 396e6e2737 abuild: add support for -devhelp subpackges
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/87
2023-04-14 08:44:48 +00:00
Marian Buschsieweke 10b4e8e8bd abuild: Fix building with spaces in path 2023-04-14 06:03:17 +00:00
Natanael Copa 16febc41a2 abuild: warn when p in pkgver should be _p
we have for example had sudo 1.9.5p2 which should have been
1.9.5_p2. Show a warning to avoid this in the future.
2023-04-07 11:27:09 +00:00
Natanael Copa 3695cd2008 apkgrel: fix usage and invalid options and add test 2023-01-10 17:47:22 +01:00
Natanael Copa e8c1ce6127 abuild: fix cleanoldpkg
we should only delete packages of the specified architecture

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10078
2022-12-06 16:59:03 +01:00
Natanael Copa ee13f777d5 abuild: fix check of maintainer address
Also disallow leading and trailing spaces/quotes.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10080
2022-12-02 16:44:53 +01:00
Natanael Copa 21880d296a abuild: add test for -dev subpackage 2022-12-01 15:53:43 +01:00
Natanael Copa b253118cca abuild: add test for -doc subpackages 2022-12-01 15:46:03 +01:00
Natanael Copa f97bf6ae8b abuild-tar: add test for --hash 2022-11-30 13:02:18 +01:00
Natanael Copa 9aeb6484b6 abuild-tar: add test for --cut 2022-11-30 12:19:34 +01:00
Natanael Copa 8a16229d3e abuild-tar: fix --help and add test for usage 2022-11-30 12:00:09 +01:00
Natanael Copa 94122d7bec tests: pre-generate abuild keys
use a fake openssl for abuild-keykey and pre-generate the abuild keys.
This makes tests run significantly faster as we dont need to generate
new keys for each abuild-keygen test.
2022-11-29 09:08:14 +00:00
Kevin Daudt b7813c377c abump: demonstrate abump environment polution
abump sources the APKBUILD to be able to check some variables. When the
APKBUILD exports variables in the global scope, that affects the abump
environment as well.

When abump then executes abuild, it will inherrit the environment from
abump. This is an issue under the following circumstances:

* The APKBUILD only updates the value of an exported variable if it's
  not set
* The default value includes a variable set by abuild, like `$srcdir`.

Because the variable is set by abuild, but not abump, the resulting
exported variable is different. Because it's then set incorrectly in the
abump environment, it's no longer updated with the correct variable when
abuild is invoked.
2022-10-15 10:52:11 +00:00
Natanael Copa 5c542377a8 abuild: fix amove corner cases
fix `amove dir` (without leading or trailing /)

add various testcases for amove
2022-09-23 12:31:56 +02:00
Natanael Copa 8357608d5f tests: functions: add test for empty but set vars
ref https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/112
2022-08-30 10:38:38 +02:00
psykose 927f14f6b3
abuild: fix package size for script-only packages 2022-08-05 16:00:36 +02:00
Natanael Copa 3a235e4d3c tests: adjust to openssl 3
openssl3 have different output to stderr when generating keys. Adjust
accordingly.
2022-08-05 13:22:02 +00:00
ptrcnull 33ce0536ef
abuild: set GIT_CEILING_DIRECTORIES before running prepare/build/check/package 2022-06-22 17:50:38 +02:00
Natanael Copa 4dbf8e3756 abuild-keygen: use doas instead of sudo
fallback to sudo if doas was not found
2022-06-22 16:41:51 +02:00