makepkg: reject PKGBUILDs with both split and non-split package functions
We accept package_foo() in non-split packages, because it's easier to switch to/from a split package just by removing a pkgname element. But it makes no sense to have both in one PKGBUILD. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
961ef1a4c8
commit
3d5a056452
1 changed files with 8 additions and 1 deletions
|
@ -34,11 +34,18 @@ lint_package_function() {
|
||||||
local i ret=0
|
local i ret=0
|
||||||
|
|
||||||
if (( ${#pkgname[@]} == 1 )); then
|
if (( ${#pkgname[@]} == 1 )); then
|
||||||
if have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then
|
if have_function 'package' && have_function "package_$pkgname"; then
|
||||||
|
error "$(gettext "Conflicting %s and %s functions in %s")" "package()" "package_$pkgname()" "$BUILDFILE"
|
||||||
|
ret=1
|
||||||
|
elif have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then
|
||||||
error "$(gettext "Missing %s function in %s")" "package()" "$BUILDFILE"
|
error "$(gettext "Missing %s function in %s")" "package()" "$BUILDFILE"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if have_function "package"; then
|
||||||
|
error "$(gettext "Extra %s function for split package '%s'")" "package()" "$pkgbase"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
for i in "${pkgname[@]}"; do
|
for i in "${pkgname[@]}"; do
|
||||||
if ! have_function "package_$i"; then
|
if ! have_function "package_$i"; then
|
||||||
error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i"
|
error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i"
|
||||||
|
|
Loading…
Add table
Reference in a new issue