[PATCH] kconfig: OVERRIDE: save kernel version in .config file

From: Randy.Dunlap
Date: Fri Sep 17 2004 - 12:53:45 EST


On Fri, 17 Sep 2004 10:20:24 -0700 Randy.Dunlap wrote:

| On Fri, 17 Sep 2004 17:43:46 +0200 Olaf Hering wrote:
|
| | Randy,
| |
| | we need a way to turn the timestamp off when running make oldconfig.
| | Running make oldconfig gives always a delta, even if the .config is
| | unchanged. This is bad for cvs repos, it generates conflicts now if 2
| | people work on the same config file.
| | Please provide a patch to not call ctime if a non-empty enviroment
| | variable of your choice is set.
|
| How's this?

Let's be a little safer in checking "NOTIMESTAMP".

Omit .config file timestamp in the file if the environment variable
"NOTIMESTAMP" exists and is non-null.

Signed-off-by: Randy Dunlap <rddunlap@xxxxxxxx>


diffstat:=
scripts/kconfig/confdata.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)

diff -Naurp ./scripts/kconfig/confdata.c~nostamp ./scripts/kconfig/confdata.c
--- ./scripts/kconfig/confdata.c~nostamp 2004-09-14 14:21:50.855120560 -0700
+++ ./scripts/kconfig/confdata.c 2004-09-17 09:31:22.655220200 -0700
@@ -270,6 +270,8 @@ int conf_write(const char *name)
int type, l;
const char *str;
time_t now;
+ int use_timestamp = 1;
+ char *env;

dirname[0] = 0;
if (name && name[0]) {
@@ -306,22 +308,28 @@ int conf_write(const char *name)
sym = sym_lookup("KERNELRELEASE", 0);
sym_calc_value(sym);
time(&now);
+ env = getenv("NOTIMESTAMP");
+ if (env && *env)
+ use_timestamp = 0;
+
fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n"
"# Linux kernel version: %s\n"
- "# %s"
+ "%s%s"
"#\n",
sym_get_string_value(sym),
- ctime(&now));
+ use_timestamp ? "# " : "",
+ use_timestamp ? ctime(&now) : "");
if (out_h)
fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n"
" * Linux kernel version: %s\n"
- " * %s"
+ "%s%s"
" */\n"
"#define AUTOCONF_INCLUDED\n",
sym_get_string_value(sym),
- ctime(&now));
+ use_timestamp ? " * " : "",
+ use_timestamp ? ctime(&now) : "");

if (!sym_change_count)
sym_clear_all_valid();


--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/