Commit Graph

652 Commits

Author SHA1 Message Date
Sertonix 88fab9f624 abuild: detect precompiled lua files
Precompiled lua files aren't portable between word sizes and byte order.
2024-10-07 19:37:16 +00:00
Sertonix 2ea6d3c734 abuild: remove empty check before for loop
When the variable is empty the body of the for loop will never be run.
So the behaviour is the same without the extra check if the variable is
empty.
2024-10-07 19:35:31 +00:00
Sertonix 87e8792b8c abuild: clean unused and global variables 2024-10-07 19:24:49 +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 f12f4dde1a abuild: simplify shell completion checks 2024-10-07 19:13:54 +00:00
Sertonix 76e82bfb52 abuild: add cmd:* providers for symlinks 2024-10-07 19:10:26 +00:00
Dimitri John Ledkov b10f1c5394
abuild: remove unused variable sign 2024-04-29 12:18:05 +01:00
Piraty a45d12d4c3
abuild-rootbld: copy SRCDEST value from host to chroot
Otherwise the default hardcoded in abuild-fetch (var/cache/distfiles) is
used.

(in the same vein as 6864df03aa)

Fixes: 1582617 ("abuild-rootbld: clear environment for bwrap container")
2024-04-26 00:24:09 +02:00
Natanael Copa 68d6aa65f4 abuild: skip /var/run in fhs check
We have many package containing directories under /var/run. Allow those
for now.

Partially reverts commit 08d2d81587 (abuild: extend fhs check)
2024-04-21 10:37:44 +02:00
Natanael Copa c48f8498e7 abuild: allow packages to install under run
I have some vauge memory that it is conveinent for Docker users that the
state dir under /run exists.

Allow this for alpine 3.20 and revisit later.
2024-04-20 08:20:18 +02:00
Natanael Copa eeca95d195 abuild: pass APORTS_BOOTSTRAP to bubblewrap 2024-04-19 23:41:45 +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
Sertonix 855992822d abuild: update cachedir logic for rootbld
Closes [#10111]

[#10111]: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10111
2024-04-12 11:59:04 +00:00
Sertonix 7276042237 abuild: always use $APK instead of apk 2024-04-12 11:59:04 +00:00
Sertonix 6aa8fcc012 abuild: remove libc specific logic
Last use of the '!libc_*' option has been removed in [61cb57cda98].
libpthread special casing only triggers on uclibc.

[61cb57cda98]: https://git.alpinelinux.org/aports/commit/?id=61cb57cda98923032f7ff15f7a0f057bb35aae6d
2024-04-12 11:56:05 +00:00
Sertonix 20b1f47c63 abuild: fix ~ splitting pkgname and pkgver 2024-04-12 11:51:48 +00:00
Sertonix 0e325a2354 abuild: fix python3 depending on python3 2024-04-03 14:09:03 +02:00
Sertonix 141da52d19 abuild: warn on go packages without net option 2024-03-29 11:15:43 +00:00
Sertonix 21b5a2298d abuild: fix help message 2024-03-29 11:14:35 +00:00
Sertonix 20c0a15856 functions.sh: fix ABUILD_USERDIR overwrite in ABUILD_CONF 2024-03-29 11:14:35 +00:00
Sertonix 1804361f61 abuild: error on digit+letter+digit version format 2024-03-29 11:12:51 +00:00
Sertonix 17648366cc abuild: invalidate pkgver ending with -r# 2024-03-28 22:41:30 +00:00
Sertonix 2e27c5b202 abuild: sanitycheck pkgver regardless of -d flag 2024-03-28 22:41:30 +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
Sertonix 08d2d81587 abuild: extend fhs check 2024-03-27 14:53:58 +01: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 648529aa35 abuild: remove duplicate SOURCE_DATE_EPOCH from .PKGINFO 2024-03-06 13:05:10 +00:00
Sertonix f63c117df6 abuild: avoid variables in sed pattern 2024-03-05 11:59:10 +00:00
Jingyun Hua e3ba1238d3 abuild.in: update autoconf test for loongarch64 2024-03-05 11:56:33 +00: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 a6a95ad633 abuild: set filetype sh for abuild.in 2023-10-17 16:33:15 +00:00
ptrcnull f688130443 abuild: simplify finding repo_template
related to #10069, this keeps the original behaviour when
running in aports and allows for using rootbld in other package repositories
2023-10-12 15:39:09 +00:00
psykose fc575e8361 abuild: fix a mistake in 0e333003df
the prefix was dropped from the check so it always says it's unregistered
no actual breakage happened as this just prints a warning
2023-07-03 04:45:13 +02:00
psykose 3e5cbbee13 abuild: unset default_lang depends unless set
for consistency with every default split
2023-06-22 20:03:32 +02:00
Sören Tempel c9b4146aaa Revert "rootbld: run mkusers inside the chroot and don't affect host users"
We can't run mkusers inside the chroot because of bwrap peculiarities.
Presently, rootbld does therefore not work at all for APKBUILDs which
use $pkggroups/$pkguser. While not polluting the host is a noble goal
it isn't really useful if it causes rootbld to be incapable of building
certain packages (i.e. those using $pkggroups/$pkguser with groups
not existent on the host).

This commit therefore restores the original behavior for now. While at
it, I also added a comment to the mkusers invocation.

See: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10094

This reverts commit 84d7b7693d.
2023-06-22 21:53:46 +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
psykose 38e84f9016 abuild: simplify et_dyn/et_exec check 2023-06-22 03:37:06 +00:00
Dimitry Andric 76ff15a7b1 abuild: unset option variables to prevent environment leaking in
In abuild's getopts loop, option variables such as "keep", "verbose",
etc are only set if the corresponding option is found. If such an option
is *not* found, any environment variable with the same name will leak
in, instead. Prevent this by explicitly unsetting almost all of them.
2023-06-22 03:35:46 +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 8d11e9f410 abuild: refactor duplicate python detection to not use find(1)
the previous implementation used -regex, which is subtly different between busybox and findutils

[0-9]\+ matches on busybox, but doesn't match with gnu findutils
[0-9]+ matches with findutils, but doesn't match on busybox

this means python deps were subtly broken when findutils was installed
(sometimes pulled via makedeps) vs not
2023-06-15 12:54:00 +00: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
Haelwenn (lanodan) Monnier 446a2a66e3 abuild. Use date -u instead of date --utc 2023-06-04 20:10:22 +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
psykose 0e333003df abuild: downgrade binfmt-registration error to a warning
strictly speaking, it is possible for an x86_64 cpu to run 32-bit
userspace binaries without qemu emulation. it is also possible for an
aarch64 cpu to run armhf/armv7 binaries (as long as the cpu implements
it, most do). rather than check for every possible combination of when
this is allowed (host cpu + emulated target, does cpu support it, ...),
just downgrade this case to a warning, to permit non-emulated use.

ref https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/117#note_255174
2023-06-01 09:29:59 +02:00