Commit Graph

156 Commits

Author SHA1 Message Date
Sertonix 35b6b30134 tests: remove 'test package' comment
These comments don't have any purpose. They just take up space.
2024-10-09 14:09:09 +00:00
Sertonix 34ef9de98f Prefer maintainer field instead of Maintainer comment
Fixes #10147
2024-10-09 14:09:09 +00:00
Sertonix b3b659a9f4 test: fix BSD-4-Clause license name 2024-10-09 09:58:53 +00:00
Sertonix d7208fa0c2 test: simplify usermerge test APKBUILD 2024-10-09 09:58:53 +00:00
Natanael Copa cd78cd5da2 Rename sanitycheck -> validate
The term validate/validation is better than sanity/sane.
2024-10-08 11:56:47 +02:00
Bart Ribbers da9269ba62 abuild: warn when files are installed to non-usr locations
As agreed upon by the TSC:
https://gitlab.alpinelinux.org/alpine/tsc/-/blob/master/minutes/2024-08-15.md?ref_type=heads#implement-usr-merge-73
Should be changed to an error once some core packages are adjusted.
2024-10-07 20:58:53 +00:00
Sertonix 06695133c9 abuild: preserve attributes without setfattr/getfattr
The setfattr/getfattr commands were not guaranteed to be available and
abuild wouldn't properly error when they are not. That may cause some
hidden issues.

Changing the code to not need setfattr/getfattr like it is done in
default_dbg ([3ad93d9a83]) and pacman mkpkg ([pacman@88d054093c1]).

The code works by first writing the stripped output into a temporary file
and then replace the contents of the already existing file without changing
any file metadata.

[3ad93d9a83]: 3ad93d9a83
[pacman@88d054093c1]: 88d054093c
2024-10-07 20:56:49 +00:00
Sertonix e36e92c6f2 abuild: calculate size only based on st_size of normal files
Fixes [#10134]

[#10134]: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10134
2024-10-07 20:53:10 +00:00
Sertonix ae059fd558 abuild: drop support for md5 and sha1 checksums 2024-10-07 20:52:19 +00:00
Sertonix 2fbfb5e700 tests: fix with changed ABUILD_USERDIR
The test suite expects ABUILD_USERDIR to be "$HOME"/.abuild but that
could be overwritten in ABUILD_CONF. So use the fixed value instead of
relying on the default.
2024-10-07 19:43:12 +00:00
Sertonix 8b1304f343 abuild: improve and test shell_escape 2024-10-07 19:22:28 +00:00
Sertonix e236b4b854 abuild: use amove more often 2024-10-07 19:17:35 +00:00
Sertonix 98dd63bf11 abuild: improve amove
- fix multiple trailing and leading /
- continue moving after error
2024-10-07 19:17:35 +00:00
Sertonix 76e82bfb52 abuild: add cmd:* providers for symlinks 2024-10-07 19:10:26 +00:00
Dimitri John Ledkov f4ea93f5f2
abuild-sign: add support for RSA256 signatures
Supported by apk-tools since v2.7.0 (2017).
2024-04-29 12:03:08 +01:00
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