Commit ac8b0e55 authored by Carlo Landmeter's avatar Carlo Landmeter

abuild: fix issue in maintainer check

seems the maintainer variable is not set anymore when building .PKGINFO
parent aa32ec14
...@@ -210,7 +210,7 @@ default_sanitycheck() { ...@@ -210,7 +210,7 @@ default_sanitycheck() {
[ -n "$pkggroup" ] && spell_error pkggroup pkggroups [ -n "$pkggroup" ] && spell_error pkggroup pkggroups
[ -n "$subpackage" ] && spell_error subpackage subpackages [ -n "$subpackage" ] && spell_error subpackage subpackages
get_maintainer || die "Provide a valid RFC822 maintainer address" check_maintainer || die "Provide a valid RFC822 maintainer address"
makedepends_has 'g++' && warning "g++ should not be in makedepends" makedepends_has 'g++' && warning "g++ should not be in makedepends"
return 0 return 0
...@@ -721,25 +721,24 @@ git_last_commit() { ...@@ -721,25 +721,24 @@ git_last_commit() {
git log --format=oneline -n 1 "$startdir" | awk '{print $1}' git log --format=oneline -n 1 "$startdir" | awk '{print $1}'
} }
# this will try to check for a valid rfc822 address
check_rfc822() {
local address="$1"
case "$address" in
*[A-Za-z0-9]*\ \<*@*.*\>) ;;
*) return 1 ;;
esac
}
get_maintainer() { get_maintainer() {
if [ -z "$maintainer" ]; then if [ -z "$maintainer" ]; then
maintainer=$(awk -F': ' '/\# *Maintainer/ {print $2}' "$APKBUILD") maintainer=$(awk -F': ' '/\# *Maintainer/ {print $2}' "$APKBUILD")
# remove surrounding whitespace # remove surrounding whitespace
maintainer=$(echo "$maintainer" | xargs) maintainer=$(echo "$maintainer" | xargs)
if ! [ -z "$maintainer" ]; then fi
check_rfc822 "$maintainer" || return 1 }
else
warning "No maintainer" check_maintainer() {
fi get_maintainer
if [ -z "$maintainer" ]; then
warning "No maintainer"
else
# try to check for a valid rfc822 address
case "$maintainer" in
*[A-Za-z0-9]*\ \<*@*.*\>) ;;
*) return 1 ;;
esac
fi fi
} }
...@@ -805,6 +804,7 @@ EOF ...@@ -805,6 +804,7 @@ EOF
fi fi
echo "commit = $last_commit" >> "$pkginfo" echo "commit = $last_commit" >> "$pkginfo"
get_maintainer
if [ -n "$maintainer" ]; then if [ -n "$maintainer" ]; then
echo "maintainer = $maintainer" >> "$pkginfo" echo "maintainer = $maintainer" >> "$pkginfo"
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment