From ddca33b4a9875a5756d3005821cc4e97424cfa94 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 20 Nov 2012 00:38:23 +0100 Subject: [PATCH] XBPS_RELVER: embed the latest git rev hash. --- configure | 4 ++++ include/xbps_api.h.in | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7ed01c91..4c91c693 100755 --- a/configure +++ b/configure @@ -193,6 +193,10 @@ echo "CPPFLAGS = -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK echo "CPPFLAGS += -DHAVE_CONFIG_H" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_SYSCONF_PATH=\\\"${ETCDIR}\\\"" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK +if [ -d .git ]; then + _gitrev=$(git rev-parse master) + echo "CPPFLAGS += -DXBPS_GIT=\\\"${_gitrev}\\\"" >>$CONFIG_MK +fi if [ -n "$DEBUG" -a "$DEBUG" != no -a "$DEBUG" != false ]; then echo "Building with debugging symbols." diff --git a/include/xbps_api.h.in b/include/xbps_api.h.in index a57de359..b23ad95e 100644 --- a/include/xbps_api.h.in +++ b/include/xbps_api.h.in @@ -61,14 +61,17 @@ #ifndef XBPS_VERSION #define XBPS_VERSION "UNSET" #endif - +#ifndef XBPS_GIT + #define XBPS_GIT "UNSET" +#endif /** * @def XBPS_RELVER * Current library release date. */ #define XBPS_RELVER "XBPS: " XBPS_VERSION \ " API: " XBPS_API_VERSION \ - " INDEX: " XBPS_PKGINDEX_VERSION + " INDEX: " XBPS_PKGINDEX_VERSION \ + " GIT: " XBPS_GIT /** * @def XBPS_META_PATH