[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: build date logging/printing



Hello

I have created small patch that causes gschem to print PACKAGE_BUILD_DATE
to log window, i found this usefull when i am not sure which one from compiled
i have running where all have same version but different local modifications.

best regards
Maciej

-- 
Maciej Pijanka
I don't fear computers, I fear lack of them -- Isaac Asimov
diff --git a/Makefile.am b/Makefile.am
index c83837d..8826420 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,15 +34,17 @@ version.h: stamp-git $(top_builddir)/configure $(srcdir)/version.h.in
 	  $(MAKE) $(AM_MAKEFLAGS) stamp-git; \
 	else :; fi
 
-	@date_ver=$(DATE_VERSION); dotted_ver=$(DOTTED_VERSION); \
+	date_ver=$(DATE_VERSION); dotted_ver=$(DOTTED_VERSION); \
 	git_commit=`cd $(srcdir) && $(GIT) rev-parse HEAD`; \
 	git_ver=`cd $(srcdir) && $(GIT) describe --always HEAD`; \
+        build_date=`LANG=C date -R`; \
 	sed -e"s:^.*\(PACKAGE_DATE_VERSION\).*$$:#define \1 \"$$date_ver\":" \
 	    -e"s:^.*\(PACKAGE_DOTTED_VERSION\).*$$:#define \1 \"$$dotted_ver\":" \
 	    -e"s:^.*\(PACKAGE_GIT_VERSION\).*$$:#define \1 \"$$git_ver\":" \
 	    -e"s:^.*\(PACKAGE_GIT_COMMIT\).*$$:#define \1 \"$$git_commit\":" \
+	    -e"s;^.*\(PACKAGE_BUILD_DATE\).*$$;#define \1 \"$$build_date\";" \
 	      < $(srcdir)/version.h.in > version.h.new; \
-	if diff version.h version.h.new > /dev/null 2>&1; then \
+	if diff -I PACKAGE_BUILD_DATE version.h version.h.new > /dev/null 2>&1; then \
 	  echo "version.h is unchanged"; \
 	  rm version.h.new; \
 	else \
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 4c33137..2974c9a 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -183,6 +183,7 @@ void main_prog(void *closure, int argc, char *argv[])
   s_log_message(
                 _("gEDA/gschem version %s%s.%s\n"), PREPEND_VERSION_STRING,
                 PACKAGE_DOTTED_VERSION, PACKAGE_DATE_VERSION);
+  s_log_message( "Build Date: %s\n", PACKAGE_BUILD_DATE );
   s_log_message(
                 _("gEDA/gschem comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.\n"));
   s_log_message(
diff --git a/version.h.in b/version.h.in
index fa1e599..582d44a 100644
--- a/version.h.in
+++ b/version.h.in
@@ -9,3 +9,6 @@
 
 /* Current 'git describe' version string. */
 /* #undef PACKAGE_GIT_VERSION */
+
+/* Package Build date */
+/* #undef PACKAGE_BUILD_DATE */

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user