]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: allow setting the version string during configuration
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Dec 2018 12:33:09 +0000 (13:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Dec 2018 12:43:20 +0000 (13:43 +0100)
This will be useful when building distro packages, because we can set the
version string to the rpm/dpkg/whatever version string, and getter reports
from end users.

meson.build
meson_options.txt
tools/meson-vcs-tag.sh

index e3641e088c002e36e1bfdda357786f1ffc2f528b..f528b4125f0fa0f106463100a66b51e09c11b25f 100644 (file)
@@ -585,6 +585,7 @@ endif
 
 vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
               meson.source_root(),
+              get_option('version-tag'),
               meson.project_version()]
 
 sed = find_program('sed')
index 1423b8998e5d3860fa245559ee0b8184764d57e4..42693bc47c09b26acaf1b591a2591518edf6e772 100644 (file)
@@ -1,6 +1,9 @@
 # -*- mode: meson -*-
 # SPDX-License-Identifier: LGPL-2.1+
 
+option('version-tag', type : 'string',
+       description : 'override the git version string')
+
 option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
        description : '''/bin, /sbin aren't symlinks into /usr''')
 option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
index 4345c2145a38b4bc1edd27d415c452ecedb0114a..1eb7668eed86b3bd0c3f622c38044be21a5439e4 100755 (executable)
@@ -4,7 +4,13 @@ set -eu
 set -o pipefail
 
 dir="$1"
-fallback="$2"
+tag="$2"
+fallback="$3"
+
+if [ -n "$tag" ]; then
+        echo "$tag"
+        exit 0
+fi
 
 # Apparently git describe has a bug where it always considers the work-tree
 # dirty when invoked with --git-dir (even though 'git status' is happy). Work