Move version number to libfsverity.h

Other library users might need it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
Eric Biggers
2020-06-05 17:29:10 -07:00
parent c1acb01d49
commit f81f77709a
3 changed files with 13 additions and 10 deletions
+3
View File
@@ -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
+5 -7
View File
@@ -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[],
+5 -3
View File
@@ -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"