Merge branch 'cmd-symlink' into 'master'

abuild: add cmd:* providers for symlinks

See merge request alpine/abuild!264
This commit is contained in:
Sertonix 2024-04-28 01:37:25 +00:00
commit 042c9be9de
2 changed files with 8 additions and 2 deletions

View File

@ -1296,8 +1296,12 @@ prepare_command_provides() {
options_has "!tracedeps" && return 0
cd "$dir" || return 1
for i in bin/* sbin/* usr/bin/* usr/sbin/*; do
if ! [ -x "$i" ] || ! [ -f "$i" ]; then
continue
# We can't check symlinks properly with absolute paths,
# subpackages and dependencies so assume that they are commands
if ! [ -L "$i" ]; then
if ! [ -x "$i" ] || ! [ -f "$i" ]; then
continue
fi
fi
# exclude any provides: lines for commands that has '@' because '@'
# is used as seperator between command name and repository. This

View File

@ -1058,6 +1058,7 @@ abuild_command_provides_body() {
chmod +x "\$pkgdir/usr/bin/foo"
cp -a "\$pkgdir/usr/bin/foo" "\$pkgdir/usr/bin/foo@"
mkdir -p "\$pkgdir/usr/bin/dir/"
ln -s /bin/not-on-the-host-system-but-in-a-dependency "\$pkgdir/usr/bin/link"
}
EOF
abuild rootpkg
@ -1065,6 +1066,7 @@ abuild_command_provides_body() {
atf_check \
-o match:"provides = cmd:foo=1.0-r0" \
-o not-match:"provides = cmd:foo@=1.0-r0" \
-o match:"provides = cmd:link=1.0-r0" \
-o not-match:"provides = cmd:dir=1.0-r0" \
grep '^provides = ' pkg/.control.testprovides/.PKGINFO
}