commit 7ce35e4c40359591a4c85201e015f6f6e73ece3a
parent 51056a54a6adbe598aeccace5955ea2c8c4596e7
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Fri, 22 May 2026 10:40:15 +0200
Fix #11423
Diffstat:
16 files changed, 52 insertions(+), 17 deletions(-)
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
@@ -3,7 +3,7 @@ project(
'c',
license: 'AGPLv3',
meson_version: '>=1.1.0',
- version: '1.5.12',
+ version: run_command('sh', 'scripts/get_version.sh', check: true).stdout().strip(),
)
cc = meson.get_compiler('c')
@@ -362,7 +362,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: 'taler_merchant_config.h',
@@ -404,4 +403,4 @@ run_target(
command: 'scripts/doxygen.meson.sh',
env: {'PACKAGE_VERSION': meson.project_version()},
)
-#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/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c
@@ -1164,7 +1164,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-donaukeyupdate.c b/src/backend/taler-merchant-donaukeyupdate.c
@@ -1109,7 +1109,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-exchangekeyupdate.c b/src/backend/taler-merchant-exchangekeyupdate.c
@@ -1106,7 +1106,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
@@ -1582,7 +1582,7 @@ main (int argc,
&merchant_connection_close),
GNUNET_GETOPT_option_timetravel ('T',
"timetravel"),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_OPTION_END
};
diff --git a/src/backend/taler-merchant-kyccheck.c b/src/backend/taler-merchant-kyccheck.c
@@ -1787,7 +1787,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-reconciliation.c b/src/backend/taler-merchant-reconciliation.c
@@ -1254,7 +1254,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-report-generator.c b/src/backend/taler-merchant-report-generator.c
@@ -928,7 +928,7 @@ main (int argc,
&test_mode),
GNUNET_GETOPT_option_timetravel ('T',
"timetravel"),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-webhook.c b/src/backend/taler-merchant-webhook.c
@@ -562,7 +562,7 @@ main (int argc,
&test_mode),
GNUNET_GETOPT_option_timetravel ('T',
"timetravel"),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/backend/taler-merchant-wirewatch.c b/src/backend/taler-merchant-wirewatch.c
@@ -696,7 +696,7 @@ main (int argc,
"test",
"run in test mode and exit when idle",
&test_mode),
- GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c
@@ -406,7 +406,7 @@ main (int argc,
"fakebank",
"use fakebank for the banking system",
&use_fakebank),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_option_help (
TALER_MERCHANT_project_data (),
"Runs benchmark logic against merchant backend. "
@@ -500,7 +500,7 @@ main (int argc,
"PN",
"will generate PN payments, defaults to 1",
&payments_number),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_OPTION_END
};
const char *default_config_file;
diff --git a/src/merchant-tools/taler-merchant-dbinit.c b/src/merchant-tools/taler-merchant-dbinit.c
@@ -123,7 +123,7 @@ main (int argc,
"reset database (DANGEROUS: all existing data is lost!)",
&reset_db),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/merchant-tools/taler-merchant-passwd.c b/src/merchant-tools/taler-merchant-passwd.c
@@ -238,7 +238,7 @@ main (int argc,
"which instance to reset the password of",
&instance),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/merchant-tools/taler-merchant-setup-reserve.c b/src/merchant-tools/taler-merchant-setup-reserve.c
@@ -401,7 +401,7 @@ main (int argc,
"CERTTYPE",
"type of the TLS client certificate, defaults to PEM if not specified",
&certtype),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
+ GNUNET_GETOPT_option_version (PACKAGE_VERSION),
GNUNET_GETOPT_option_mandatory (
GNUNET_GETOPT_option_string ('w',
"wire-method",