diff --git a/contrib/fedora/rpm/release.sh b/contrib/fedora/rpm/release.sh index 33a8b5f36..a9e452a6a 100755 --- a/contrib/fedora/rpm/release.sh +++ b/contrib/fedora/rpm/release.sh @@ -93,14 +93,17 @@ do_command() { fi } +SCRIPTDIR="$(dirname "$(readlink -f "$0")")" +GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")" + parse_version() { local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \ | cut -d"'" -f2 \ | sed 's/\./ /g') re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$' - [[ "$MAJ $MIN $MIC" =~ $re ]] || return 1 - echo "$MAJ $MIN $MIC" + [[ "$VERSION" =~ $re ]] || return 1 + echo "$VERSION" } number_is_even() {