tagscript: add sanity checks on version number

This commit is contained in:
Travis Cross 2012-05-07 22:02:44 +00:00
parent 55330e0e56
commit d864e66d62
1 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,19 @@ fi
eval $(parse_version "$1")
ngrep () { (echo "$2" | grep -e "$1" >/dev/null); }
err () { echo "$1" >&2; exit 1; }
ngrep '^[1-9]*$' "$gmajor" || \
err "The major version '$gmajor' appears invalid."
ngrep '^[0-9]*$' "$gminor" || \
err "The minor version '$gminor' appears invalid."
[ -z "$gmicro" ] || ngrep '^[0-9]*$' "$gmicro" || \
err "The micro version '$gmicro' appears invalid."
[ -z "$grev" ] || ngrep '^[.-]' "$grev" || \
err "The revision '$grev' appears invalid."
echo "We're going to release freeswitch v$gver" >&2
echo >&2
if ! ($debug || ngrep '-s' "$opts"); then
cat >&2 <<EOF