[arch-projects] [namcap] [PATCH] parsepkgbuild.sh: fix detection of split pkgbuilds with empty pkgbase

Michael Straube michael.straube at posteo.de
Wed Oct 31 09:35:52 UTC 2018


For split pkgbuilds the pkgbase variable is optional. If not specified,
the first element in the pkgname array is used. Currently parsepkgbuild.sh
fails to detect split pkgbuilds if pkgbase is not specified. Therefore the
split pkgbuild rules are not applied to such pkgbuilds.

Instead of testing if pkgbase is set, test if the pkgname array has more
than one element. If so, set pkgbase accordingly.

Signed-off-by: Michael Straube <michael.straube at posteo.de>
---
 parsepkgbuild.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/parsepkgbuild.sh b/parsepkgbuild.sh
index a158d1e..d85574d 100644
--- a/parsepkgbuild.sh
+++ b/parsepkgbuild.sh
@@ -140,7 +140,8 @@ compgen -A variable
 }
 
 # is it a split pkgbuild ?
-if [ -n "${pkgbase}" ]; then
+if [ "${#pkgname[@]}" -gt 1 ]; then
+	pkgbase=${pkgbase:-${pkgname[0]}}
 	_namcap_pkgnames=(${pkgname[@]})
 	unset pkgname
 	echo -e "%SPLIT%\n1\n"
-- 
2.19.1


More information about the arch-projects mailing list