[fedfs-utils] [PATCH/RFC fedfs-utils] Optionally remove use of __DATE__ and __TIME__ when building.

NeilBrown neilb at suse.de
Tue Feb 25 21:41:16 PST 2014



Use of __DATE__ and __TIME__ makes it impossible to recompile after
possibly changing context and see the context made any real change in
the resulting build.
The Open Build Service can do this (to optimise rebuilds) and so
discourages the use of __DATE__ and __TIME__

This patch makes it easy to disable the use of __DATE__ and __TIME__
in src/fedfsd/main.c by setting CPPFLAGS.

Possibly a ./configure option should be created instead.

Signed-off-by: NeilBrown <neilb at suse.de>

diff --git a/src/fedfsd/main.c b/src/fedfsd/main.c
index f6ca61f7d6e8..edf96c90577a 100644
--- a/src/fedfsd/main.c
+++ b/src/fedfsd/main.c
@@ -165,8 +165,12 @@ int main(int argc, char **argv)
 			break;
 		case '?':
 			fprintf(stderr, "Version " VERSION
-					", built on %s at %s\n\n",
-					__DATE__, __TIME__);
+				#ifndef NO_DATE_TIME
+					", built on " __DATE__
+					" at " __TIME __
+				#endif
+					"\n\n"
+				);
 			fedfsd_usage(progname);
 			break;
 		case 'o':
@@ -230,8 +234,11 @@ int main(int argc, char **argv)
 		}
 	}
 
-	xlog(L_NOTICE, "Version " VERSION " (built %s at %s) starting",
-			__DATE__, __TIME__);
+	xlog(L_NOTICE, "Version " VERSION
+	     #ifndef NO_DATE_TIME
+	     " (built " __DATE__ " at " __TIME__ ")"
+	     #endif
+	     " starting");
 
 	if (!fedfsd_set_up_authenticators())
 		exit(EXIT_FAILURE);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/fedfs-utils-devel/attachments/20140226/9e4803d7/attachment.bin 


More information about the fedfs-utils-devel mailing list