From 180f6e373922c1c92d3f1d28f7ba64aa2d4d04a0 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Mon, 16 Sep 2024 11:28:25 +0200 Subject: [PATCH] release: fix version parsing from meson Fixes: 6707ce0754e8 ('build: use meson for version info') --- contrib/fedora/rpm/release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() {