mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-21 14:40:09 +00:00
abuild: stricter pkgname check
This commit is contained in:
parent
73cc75b3e0
commit
a9053617db
@ -180,9 +180,8 @@ spell_error() {
|
||||
}
|
||||
|
||||
verify_pkgname() {
|
||||
local name=${1%%=*}
|
||||
case "$name" in
|
||||
""|*" "*|-*) return 1;;
|
||||
case $1 in
|
||||
''|*[!a-zA-Z0-9._+-]*|[!a-zA-Z0-9]*) return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
@ -415,6 +415,9 @@ abuild_valid_pkgnames_body() {
|
||||
TESTSUBNAME=foo atf_check -s exit:0 \
|
||||
-e match:"Checking sanity" \
|
||||
abuild sanitycheck
|
||||
TESTNAME="more_+-2.0-complicated" atf_check -s exit:0 \
|
||||
-e match:"Checking sanity" \
|
||||
abuild sanitycheck
|
||||
}
|
||||
|
||||
abuild_invalid_pkgnames_body() {
|
||||
@ -430,6 +433,12 @@ abuild_invalid_pkgnames_body() {
|
||||
TESTNAME="foo with spaces" atf_check -s exit:1 \
|
||||
-e match:"Checking sanity" \
|
||||
abuild sanitycheck
|
||||
TESTNAME="width@at" atf_check -s exit:1 \
|
||||
-e match:"Checking sanity" \
|
||||
abuild sanitycheck
|
||||
TESTNAME="width=equal" atf_check -s exit:1 \
|
||||
-e match:"Checking sanity" \
|
||||
abuild sanitycheck
|
||||
}
|
||||
|
||||
abuild_invalid_subpkgnames_body() {
|
||||
|
Loading…
Reference in New Issue
Block a user