[PATCH] configure: add git describe output to PG_VERSION when building a git tree - Mailing list pgsql-hackers

From Oskari Saarenmaa
Subject [PATCH] configure: add git describe output to PG_VERSION when building a git tree
Date
Msg-id 20131105102226.GA26836@saarenmaa.fi
Whole thread Raw
Responses Re: [PATCH] configure: add git describe output to PG_VERSION when building a git tree  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
This makes it easy to see if the binaries were built from a real release
or if they were built from a custom git tree.
---configure.in | 9 ++++++++-1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index a4baeaf..7c5b3ce 100644
--- a/configure.in
+++ b/configure.in
@@ -29,7 +29,14 @@ AC_CONFIG_AUX_DIR(config)AC_PREFIX_DEFAULT(/usr/local/pgsql)AC_SUBST(configure_args,
[$ac_configure_args])
-AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version as a string])
+# Append git tag based version to PG_VERSION if we're building from a git
+# checkout, but don't touch PACKAGE_VERSION which is used to create other
+# version variables (major version and numeric version.)
+PG_VERSION="$PACKAGE_VERSION"
+if test -d .git; then
+  PG_VERSION="$PG_VERSION (`git describe --tags --long --dirty HEAD || echo unknown`)"
+fi
+AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])[PG_MAJORVERSION=`expr
"$PACKAGE_VERSION": '\([0-9][0-9]*\.[0-9][0-9]*\)'`]AC_SUBST(PG_MAJORVERSION)AC_DEFINE_UNQUOTED(PG_MAJORVERSION,
"$PG_MAJORVERSION",[PostgreSQL major version as a string])
 
-- 
1.8.4.2




pgsql-hackers by date:

Previous
From: Leonardo Francalanci
Date:
Subject: Re: Fast insertion indexes: why no developments
Next
From: Simon Riggs
Date:
Subject: Re: Fast insertion indexes: why no developments