Commit Graph

21 Commits

Author SHA1 Message Date
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
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
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 07894fa745 tests: abuild: port invalid-initd test 2022-06-22 16:13:07 +02:00
Natanael Copa 1913c6929c tests: refacgor abuild build failure 2022-06-22 16:13:07 +02:00
Olliver Schinagl f5d6e5e34b abuild: Do not store whitespaces in license field
Currently, abuild stores the license variable ad-verbatim in the PKGINFO
file. This causes many downstream systems to fail. For example, `apk
info` won't show anything after the newline, our webview that lists
licenses do not show these either.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-06-14 12:08:01 +00:00
Natanael Copa 681ef9dfcf tests: add test with invalid version of subpkgs' dependency
Ref: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10058
2022-01-17 16:17:25 +01:00
Natanael Copa 070341e21d tests: add tests for invalid pkgname
Add s test for valid pkgnames to verify the testsuite APKBUILD actually
works as intended, and a few tests for invalid pkgnames
2022-01-17 15:36:49 +01:00
Alex Xu (Hello71) 3ad93d9a83 abuild: default_dbg: various fixes
- fix symlinks
- fix hard links
- fix dbg not first
- fix scan race condition
- fix (non-extended) attrs
- general refactoring
2021-10-11 15:33:01 +00:00
Alex D. ba127ff45c abuild: use sourced filename instead of whole line for initd checks 2021-10-11 14:46:43 +00:00
Leo 2ed215fa32 tests(abuild): test whether pyX.Y providers work 2021-05-06 10:50:57 -03:00
Natanael Copa f23cf180c9 tests: simplify subpkg-dep-leak 2021-04-30 11:14:49 +02:00
Kevin Daudt cf6cd0231f tests: verify subpkg dependencies don't influence main package
Subpackages can declare their own dependencies, but these should not
affect the main package.

Add a test that verifies this behaviour.
2021-04-30 10:43:09 +02:00
Natanael Copa 39b552751e tests: add test for -dbg package 2021-04-28 10:44:28 +02:00
Natanael Copa b4d975a11f tests: add missing test for invalid filename
fixes commit f35f2aa859 (abuild: add test for invalid filenames)
2021-04-20 16:21:33 +02:00
Natanael Copa 614fbc507b tests: add test for lib64 2020-10-29 14:46:46 +00:00
Natanael Copa 3a75c39860 tests: test for build failure 2020-10-29 13:30:30 +00:00
Natanael Copa 43fb2c012e add basic tests using bats 2019-11-07 11:32:37 +00:00