From af885e156ed91f8251bd91534fe9cfe994b3e0f7 Mon Sep 17 00:00:00 2001 From: Tom Goff Date: Tue, 26 Jan 2016 17:01:23 -0500 Subject: [PATCH] build: Include revision information in distributions. --- .gitignore | 2 ++ Makefile.am | 7 +++++++ revision.sh | 12 ++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4ede8b4a..6289e42c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .deps +.version +.version.date Makefile Makefile.in aclocal.m4 diff --git a/Makefile.am b/Makefile.am index 316d9855..bf61306d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,7 @@ ACLOCAL_AMFLAGS = -I config # extra files to include with distribution tarball EXTRA_DIST = bootstrap.sh LICENSE README-Xen Changelog kernel \ python-prefix.py revision.sh \ + .version .version.date \ packaging/bsd \ packaging/deb/compat \ packaging/deb/copyright \ @@ -70,3 +71,9 @@ core-restart: daemon/sbin/core-cleanup rm -f /var/log/core-daemon.log /etc/init.d/core-daemon start + +.version: + echo $(CORE_VERSION) > $@ + +.version.date: + echo $(CORE_VERSION_DATE) > $@ diff --git a/revision.sh b/revision.sh index 3cf1acd0..661506fe 100755 --- a/revision.sh +++ b/revision.sh @@ -44,7 +44,11 @@ esac _revision() { - echo $1$2 + if [ -r .version ]; then + cat .version + else + echo $1$2 + fi } git_revision() @@ -124,7 +128,11 @@ svn_revision() _date() { - date '+%Y%m%d' + if [ -r .version.date ]; then + cat .version.date + else + date '+%Y%m%d' + fi } git_date()