Skip to content
Snippets Groups Projects
Commit 03b674c3 authored by Sertonix's avatar Sertonix Committed by Natanael Copa
Browse files

abuild: simplify {replaces,provider}_priority validation with case

Also this way is much safer since it isn't using echo or shell expansion
parent f11b7905
No related branches found
No related tags found
No related merge requests found
......@@ -212,15 +212,13 @@ default_validate() {
fi
is_function package || die "Missing package() function in APKBUILD"
if [ -n "$replaces_priority" ] \
&& ! echo $replaces_priority | grep -E -q '^[0-9]+$'; then
die "replaces_priority must be a number"
fi
case "$replaces_priority" in
*[!0-9]*) die "replaces_priority must be a number" ;;
esac
if [ -n "$provider_priority" ] \
&& ! echo $provider_priority | grep -E -q '^[0-9]+$'; then
die "provider_priority must be a number"
fi
case "$provider_priority" in
*[!0-9]*) die "provider_priority must be a number" ;;
esac
# check pkgname and subpkgnames
for i in "$pkgname" $subpackages; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment