mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-02-01 20:22:51 +00:00
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>
This commit is contained in:
parent
0ab9d5b621
commit
f5d6e5e34b
@ -1135,7 +1135,7 @@ prepare_metafiles() {
|
||||
echo "provider_priority = $provider_priority" >> "$pkginfo"
|
||||
fi
|
||||
|
||||
echo "license = $license" >> "$pkginfo"
|
||||
echo "license = $(echo $license)" >> "$pkginfo"
|
||||
for i in $replaces; do
|
||||
echo "replaces = $i" >> "$pkginfo"
|
||||
done
|
||||
|
@ -239,3 +239,9 @@ setup() {
|
||||
! TESTDEPVER="1.0-0" $ABUILD all
|
||||
}
|
||||
|
||||
@test "abuild: check multi-line licenses" {
|
||||
cd 'testrepo/test-licenses'
|
||||
$ABUILD rootpkg
|
||||
grep '^license = MIT AND GPL-3.0-only OR GPL-3.0-or-later AND BSD-Clause-4$' \
|
||||
"${APORTSDIR}/test-licenses/pkg/.control.test-licenses/.PKGINFO"
|
||||
}
|
||||
|
31
tests/testrepo/test-licenses/APKBUILD
Normal file
31
tests/testrepo/test-licenses/APKBUILD
Normal file
@ -0,0 +1,31 @@
|
||||
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
|
||||
|
||||
# test package
|
||||
pkgname="${TESTNAME-test-licenses}"
|
||||
pkgver="1.0"
|
||||
pkgrel=0
|
||||
pkgdesc='Dummy test package that has multi-line licenses'
|
||||
url='https://gitlab.alpinelinux.org/alpine/aports'
|
||||
arch='noarch'
|
||||
license='MIT AND
|
||||
GPL-3.0-only OR
|
||||
|
||||
GPL-3.0-or-later AND
|
||||
BSD-Clause-4
|
||||
'
|
||||
|
||||
prepare() {
|
||||
mkdir -p "${builddir}"
|
||||
}
|
||||
|
||||
build() {
|
||||
touch foo
|
||||
}
|
||||
|
||||
check() {
|
||||
true
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "${pkgdir}"
|
||||
}
|
Loading…
Reference in New Issue
Block a user