xbps-src/shutils/common.sh: check $version, - and _ are now forbidden.

This commit is contained in:
Christian Neukirchen 2015-03-20 19:06:18 +01:00
parent e0f47fed67
commit ca81f8e7f1
1 changed files with 10 additions and 0 deletions

View File

@ -289,6 +289,16 @@ setup_pkg() {
fi fi
done done
# Check if version is valid.
case "$version" in
*-*) msg_error "version contains invalid character: -\n";;
*_*) msg_error "version contains invalid character: _\n";;
esac
case "$version" in
*[0-9]*) : good ;;
*) msg_error "version must contain at least one digit.\n";;
esac
# Check if base-chroot is already installed. # Check if base-chroot is already installed.
if [ -z "$bootstrap" ]; then if [ -z "$bootstrap" ]; then
check_installed_pkg base-chroot-0.1_1 check_installed_pkg base-chroot-0.1_1