From 8465a0f64e74b33d668ad503b9a314b46a09c669 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 18 Nov 2021 10:40:59 +0100 Subject: [PATCH] build: Don't use external script to set version 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 --- meson.build | 2 +- nvme-cli-version | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100755 nvme-cli-version diff --git a/meson.build b/meson.build index 7a1cc0dc..fcfe446c 100644 --- a/meson.build +++ b/meson.build @@ -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 index 3a2987ca..00000000 --- a/nvme-cli-version +++ /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" - - -- 2.50.1