diff --git a/abuild.in b/abuild.in index 1500485..38cb842 100755 --- a/abuild.in +++ b/abuild.in @@ -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 diff --git a/tests/abuild.bats b/tests/abuild.bats index 4ff57df..f204acf 100644 --- a/tests/abuild.bats +++ b/tests/abuild.bats @@ -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" +} diff --git a/tests/testrepo/test-licenses/APKBUILD b/tests/testrepo/test-licenses/APKBUILD new file mode 100644 index 0000000..6f1ecb0 --- /dev/null +++ b/tests/testrepo/test-licenses/APKBUILD @@ -0,0 +1,31 @@ +# Maintainer: Olliver Schinagl + +# 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}" +}