mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: lkml <linux-kernel@vger.kernel.org>
Cc: olh@suse.de, akpm@osdl.org, sam@ravnborg.org
Subject: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
Date: Fri, 17 Sep 2004 10:43:34 -0700	[thread overview]
Message-ID: <20040917104334.1b7d7d19.rddunlap@osdl.org> (raw)
In-Reply-To: <20040917102024.50188756.rddunlap@osdl.org>

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@osdl.org>


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();


--

  parent reply	other threads:[~2004-09-17 17:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-17 15:43 kconfig: " Olaf Hering
2004-09-17 17:20 ` [PATCH] kconfig: OVERRIDE: " Randy.Dunlap
2004-09-17 17:42   ` Olaf Hering
2004-09-17 17:43   ` Randy.Dunlap [this message]
2004-10-16 21:29     ` Sam Ravnborg
2004-10-16 20:18       ` Roman Zippel
2004-10-16 20:29         ` Olaf Hering
2004-10-16 22:27         ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040917104334.1b7d7d19.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olh@suse.de \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®