[fedfs-utils] [PATCH/RFC fedfs-utils] Optionally remove use of __DATE__ and __TIME__ when building.
Chuck Lever
chuck.lever at oracle.com
Tue Feb 25 21:55:10 PST 2014
I might prefer setting the build date in configure.ac, or removing these in favor of simply using VERSION by itself.
--
Chuck Lever
> On Feb 25, 2014, at 9:41 PM, NeilBrown <neilb at suse.de> wrote:
>
>
>
> 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);
> _______________________________________________
> fedfs-utils-devel mailing list
> fedfs-utils-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/fedfs-utils-devel
More information about the fedfs-utils-devel
mailing list