aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-06-05 17:29:10 -0700
committerEric Biggers <ebiggers@google.com>2020-06-05 17:29:10 -0700
commitf81f77709a91164d169eff7434021c0ed40743ae (patch)
tree50153d6e9c82aa1cbb0b831593eee9196b451d47
parentc1acb01d4909495ae359a61aeed05b9830655281 (diff)
downloadfsverity-utils-f81f77709a91164d169eff7434021c0ed40743ae.tar.gz
Move version number to libfsverity.h
Other library users might need it. Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r--common/libfsverity.h3
-rw-r--r--programs/fsverity.c12
-rwxr-xr-xscripts/do-release.sh8
3 files changed, 13 insertions, 10 deletions
diff --git a/common/libfsverity.h b/common/libfsverity.h
index f055779..d7f616f 100644
--- a/common/libfsverity.h
+++ b/common/libfsverity.h
@@ -17,6 +17,9 @@ extern "C" {
#include <stddef.h>
#include <stdint.h>
+#define FSVERITY_UTILS_MAJOR_VERSION 1
+#define FSVERITY_UTILS_MINOR_VERSION 0
+
#define FS_VERITY_HASH_ALG_SHA256 1
#define FS_VERITY_HASH_ALG_SHA512 2
diff --git a/programs/fsverity.c b/programs/fsverity.c
index 1a90cba..7af0417 100644
--- a/programs/fsverity.c
+++ b/programs/fsverity.c
@@ -82,20 +82,18 @@ void usage(const struct fsverity_command *cmd, FILE *fp)
usage_all(fp);
}
-#define PACKAGE_VERSION "v1.0"
-#define PACKAGE_BUGREPORT "linux-fscrypt@vger.kernel.org"
-
static void show_version(void)
{
- static const char * const str =
-"fsverity " PACKAGE_VERSION "\n"
+ printf(
+"fsverity v%d.%d\n"
"Copyright 2018 Google LLC\n"
"License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n"
"\n"
-"Report bugs to " PACKAGE_BUGREPORT ".\n";
- fputs(str, stdout);
+"Report bugs to linux-fscrypt@vger.kernel.org.\n",
+ FSVERITY_UTILS_MAJOR_VERSION,
+ FSVERITY_UTILS_MINOR_VERSION);
}
static void handle_common_options(int argc, char *argv[],
diff --git a/scripts/do-release.sh b/scripts/do-release.sh
index 6250060..667bb3c 100755
--- a/scripts/do-release.sh
+++ b/scripts/do-release.sh
@@ -12,9 +12,11 @@ fi
VERS=$1
PKG=fsverity-utils-$VERS
-sed -E -i \
- "/\#define PACKAGE_VERSION/s/v[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?/v$VERS/" \
- fsverity.c
+major=$(echo "$VERS" | cut -d. -f1)
+minor=$(echo "$VERS" | cut -d. -f2)
+sed -E -i -e "/FSVERITY_UTILS_MAJOR_VERSION/s/[0-9]+/$major/" \
+ -e "/FSVERITY_UTILS_MINOR_VERSION/s/[0-9]+/$minor/" \
+ common/libfsverity.h
git commit -a --signoff --message="v$VERS"
git tag --sign "v$VERS" --message="$PKG"