]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: Don't use external script to set version
authorDaniel Wagner <dwagner@suse.de>
Thu, 18 Nov 2021 09:40:59 +0000 (10:40 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 18 Nov 2021 09:40:59 +0000 (10:40 +0100)
The meson documentation points out the the version string should be a
fixed string. Our trick with trying to figure out the version is not
working in all cases, e.g. 'meson dist' will create a wrong file name.

The idea is to update the version string when a new development cycle
starts and mark the release with a tag. This is what other projects
do as well. Let's follow their common practice.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
meson.build
nvme-cli-version [deleted file]

index 7a1cc0dc03d429ffdd7e8240792d13673e83b989..fcfe446cb35fc86bec47d79a484505c49c64f695 100644 (file)
@@ -3,7 +3,7 @@ project(
     'nvme-cli', ['c', 'cpp'],
     meson_version: '>= 0.47.0',
     license: 'LGPLv2+',
-    version: run_command('./nvme-cli-version', check : true).stdout().strip(),
+    version: '2.0',
     default_options: [
       'c_std=gnu99',
       'buildtype=release',
diff --git a/nvme-cli-version b/nvme-cli-version
deleted file mode 100755 (executable)
index 3a2987c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-DEF_VER=v1.14
-
-LF='
-'
-
-if test -d .git -o -f .git &&
-       VN=$(git describe --tags --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
-       case "$VN" in
-       *$LF*) (exit 1) ;;
-       v[0-9]*)
-               git update-index -q --refresh
-               test -z "$(git diff-index --name-only HEAD --)" ||
-               VN="$VN-dirty" ;;
-       esac
-then
-       VN=$(echo "$VN" | sed -e 's/-/./g');
-else
-       VN="$DEF_VER"
-fi
-
-VN=$(expr "$VN" : v*'\(.*\)')
-
-echo "$VN"
-
-