libmakepkg: check if PACKAGER has the expected format for WKD lookup

pacman should be able to extract an email address from PACKAGER for WKD
lookup, so issue a warning if it is not of the form
"Example Name <email@address.invalid>". Neither the name nor the email
address must contain additional angle brackets.

Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jonas Witschel 2019-10-02 16:40:56 +02:00 committed by Allan McRae
parent 6f3810793f
commit fd70c1c7bb

View file

@ -60,5 +60,11 @@ lint_config_variables() {
fi
done
# pacman should be able to extract an email address from PACKAGER for WKD key lookup
local match='^([^<>]+ )?<[^<>]*>$'
if ! [[ $PACKAGER =~ $match ]]; then
warning "$(gettext "PACKAGER should have the format 'Example Name <email@address.invalid>'")"
fi
return $ret
}