release: fix version parsing from meson
Fixes: 6707ce0754
('build: use meson for version info')
This commit is contained in:
@@ -93,14 +93,17 @@ do_command() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
|
||||||
|
GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")"
|
||||||
|
|
||||||
parse_version() {
|
parse_version() {
|
||||||
local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \
|
local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \
|
||||||
| cut -d"'" -f2 \
|
| cut -d"'" -f2 \
|
||||||
| sed 's/\./ /g')
|
| sed 's/\./ /g')
|
||||||
|
|
||||||
re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
|
re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
|
||||||
[[ "$MAJ $MIN $MIC" =~ $re ]] || return 1
|
[[ "$VERSION" =~ $re ]] || return 1
|
||||||
echo "$MAJ $MIN $MIC"
|
echo "$VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
number_is_even() {
|
number_is_even() {
|
||||||
|
Reference in New Issue
Block a user