commit 2615be3e2d944462cf6e0142a3e9ef73879db479
parent 3240d701bd8244908caf8e21a0c5725ac22acd43
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Fri, 22 May 2026 11:25:36 +0200
Fix #11423
Diffstat:
6 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,4 +1,5 @@
**~
+.version
INSTALL
Makefile
aclocal.m4
diff --git a/flake.lock b/flake.lock
@@ -433,11 +433,11 @@
},
"nixpkgs_16": {
"locked": {
- "lastModified": 1776360938,
- "narHash": "sha256-Tq/T/Us82tBQIRuyuZyWR1EMVJ0EStmk/u8qQgsKlVM=",
+ "lastModified": 1776946615,
+ "narHash": "sha256-Q4SmvLr7PxHm9BLCcsKf4iH3IzIZgqFxV/bk5j4H6AM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "67664cad2361605c8fce9712d9ce6a8e026d2380",
+ "rev": "6ea81a59ced133851d02042d2ba8c2911fd54546",
"type": "github"
},
"original": {
diff --git a/meson-dist-script b/meson-dist-script
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cp $MESON_SOURCE_ROOT/.version $MESON_DIST_ROOT
diff --git a/meson.build b/meson.build
@@ -4,6 +4,7 @@ project(
license: 'AGPLv3',
meson_version: '>=1.1.0',
version: '1.6.0',
+ version: run_command('sh', 'scripts/get_version.sh', check: true).stdout().strip(),
)
cc = meson.get_compiler('c')
@@ -240,7 +241,6 @@ if not get_option('only-doc')
private_config.set_quoted('PACKAGE_VERSION', meson.project_version())
# Compatibility. Used in source.
private_config.set_quoted('VERSION', meson.project_version())
- private_config.set_quoted('VCS_VERSION', 'mesonbuild')
private_config.set_quoted('PACKAGE_BUGREPORT', 'taler@gnu.org')
configure_file(output: 'paivana_config.h', configuration: private_config)
configuration_inc = include_directories('.')
@@ -270,4 +270,4 @@ else
endif
endif
-#meson.add_dist_script('meson-dist-script')
+meson.add_dist_script('meson-dist-script')
diff --git a/scripts/get_version.sh b/scripts/get_version.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Gets the version number from git, or from the contents of .version
+VERSION=
+if test -f ".version"; then
+ VERSION=$(cat .version)
+fi
+if [ -e ./.git ]; then
+ # With sparse checkouts, we have a .git dir but possibly no tags
+ gitver=$(git describe --tags 2>/dev/null || echo no-git-version)
+ if test "$gitver" != "no-git-version"; then
+ VERSION=${gitver#v}
+ echo "$VERSION" > .version
+ fi
+fi
+if test "x$VERSION" = "x"; then
+ VERSION="unknown"
+fi
+case $1 in
+"--major")
+ echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/g'
+ ;;
+"--minor")
+ echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/g'
+ ;;
+"--micro")
+ echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/g'
+ ;;
+"--git")
+ echo "$VERSION" | sed 's/\(^[0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\)/\4/g'
+ ;;
+*)
+ echo "$VERSION"
+esac
diff --git a/src/backend/paivana_pd.c b/src/backend/paivana_pd.c
@@ -33,7 +33,7 @@ static const struct GNUNET_OS_ProjectData paivana_project_data = {
.libname = "libpaivana",
.project_dirname = "paivana",
.binary_name = "paivana-httpd",
- .version = PACKAGE_VERSION " " VCS_VERSION,
+ .version = PACKAGE_VERSION,
.env_varname = "PAIVANA_PREFIX",
.base_config_varname = "PAIVANA_BASE_CONFIG",
.bug_email = "taler@gnu.org",