summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2016-08-27 23:02:32 +0100
committerToby Goodwin <toby@paccrat.org>2016-08-27 23:02:32 +0100
commit89f1e1b445c2c50ffb61fa1327e11c475eb1b57f (patch)
treefd0f294e72da286f2e7253859376859084599c96
parent98036baceaea6c37af19b64af547eb98b2ea19ee (diff)
replace problematic reldate with git describe (thanks @RamKromberg)
-rw-r--r--configure.ac4
-rw-r--r--history.c2
-rw-r--r--main.c5
-rw-r--r--version.c.in2
4 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index e86bef6..de243a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@ dnl Our package name, version, ...
AC_INIT([rc], [1.7.4])
dnl ... and release date
-RELDATE=`date +%Y-%m-%d`
-AC_DEFINE_UNQUOTED(RELDATE, "$RELDATE", [Release date])
+DESCRIPTION=$(git describe || echo '(git description unavailable)')
+AC_DEFINE_UNQUOTED(DESCRIPTION, "$DESCRIPTION", [Release date])
dnl Get things going...
AC_CONFIG_SRCDIR([rc.h])
diff --git a/history.c b/history.c
index 1f22f2e..42e1ba2 100644
--- a/history.c
+++ b/history.c
@@ -20,7 +20,7 @@
#include <stdio.h>
-static const char id[] = "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $";
+static const char id[] = "$Release: @(#)" PACKAGE " " VERSION " " DESCRIPTION " $";
#define CHUNKSIZE 65536
diff --git a/main.c b/main.c
index 4da3014..9743a2c 100644
--- a/main.c
+++ b/main.c
@@ -84,7 +84,10 @@ quitopts:
#endif
assigndefault("pid", nprint("%d", rc_pid), (void *)0);
assigndefault("prompt", "; ", "", (void *)0);
- assigndefault("version", VERSION, "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $", (void *)0);
+ assigndefault("version",
+ VERSION,
+ "$Release: @(#)" PACKAGE " " VERSION " " DESCRIPTION " $",
+ (void *)0 );
initenv(envp);
initinput();
null[0] = NULL;
diff --git a/version.c.in b/version.c.in
index 967f0eb..691c9b0 100644
--- a/version.c.in
+++ b/version.c.in
@@ -1 +1 @@
-const char id[] = "@(#)@PACKAGE@ version @VERSION@, @RELDATE@.";
+const char id[] = "@(#)@PACKAGE@ version @VERSION@, @DESCRIPTION@.";