public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kconfig: save kernel version in .config file
@ 2004-09-17 15:43 Olaf Hering
  2004-09-17 17:20 ` [PATCH] kconfig: OVERRIDE: " Randy.Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2004-09-17 15:43 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel


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.

http://linux.bkbits.net:8080/linux-2.5/cset@411638e5ljptW-TmFM1SHBiIEg63OA

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-09-17 15:43 kconfig: save kernel version in .config file Olaf Hering
@ 2004-09-17 17:20 ` Randy.Dunlap
  2004-09-17 17:42   ` Olaf Hering
  2004-09-17 17:43   ` Randy.Dunlap
  0 siblings, 2 replies; 8+ messages in thread
From: Randy.Dunlap @ 2004-09-17 17:20 UTC (permalink / raw)
  To: Olaf Hering, akpm; +Cc: linux-kernel, sam

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?



Omit .config file timestamp in the file if the environment
variable "NOTIMESTAMP" is present (its value is not checked).

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 08:51:42.050127184 -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)
+		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();
--

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-09-17 17:20 ` [PATCH] kconfig: OVERRIDE: " Randy.Dunlap
@ 2004-09-17 17:42   ` Olaf Hering
  2004-09-17 17:43   ` Randy.Dunlap
  1 sibling, 0 replies; 8+ messages in thread
From: Olaf Hering @ 2004-09-17 17:42 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: akpm, linux-kernel, sam

 On Fri, Sep 17, 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?

good, thanks!

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-09-17 17:20 ` [PATCH] kconfig: OVERRIDE: " Randy.Dunlap
  2004-09-17 17:42   ` Olaf Hering
@ 2004-09-17 17:43   ` Randy.Dunlap
  2004-10-16 21:29     ` Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Randy.Dunlap @ 2004-09-17 17:43 UTC (permalink / raw)
  To: lkml; +Cc: olh, akpm, sam

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


--

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  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
  0 siblings, 2 replies; 8+ messages in thread
From: Roman Zippel @ 2004-10-16 20:18 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Randy.Dunlap, lkml, olh, akpm

Hi,

On Sat, 16 Oct 2004, Sam Ravnborg wrote:

> Applied - but I named it KCONFIG_TIMESTAMP so people would not
> think that kbuild suddenly stopped checking timestamps.

That reminds me, I'm not really happy with this patch, it's a hack not a 
real solution, either we save the timestamp always or not at all, making 
it dependent on an environment variable is IMO ugly.
I have a patch which does some tighter checking during config loading, 
which can be used whether it's needed to write the config. Other front 
ends could use this as well (e.g. xconfig right now always ask to save
the config).

bye, Roman

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-10-16 20:18       ` Roman Zippel
@ 2004-10-16 20:29         ` Olaf Hering
  2004-10-16 22:27         ` Sam Ravnborg
  1 sibling, 0 replies; 8+ messages in thread
From: Olaf Hering @ 2004-10-16 20:29 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Sam Ravnborg, Randy.Dunlap, lkml, akpm

 On Sat, Oct 16, Roman Zippel wrote:

> Hi,
> 
> On Sat, 16 Oct 2004, Sam Ravnborg wrote:
> 
> > Applied - but I named it KCONFIG_TIMESTAMP so people would not
> > think that kbuild suddenly stopped checking timestamps.
> 
> That reminds me, I'm not really happy with this patch, it's a hack not a 
> real solution, either we save the timestamp always or not at all, making 
> it dependent on an environment variable is IMO ugly.

The point is: avoid conflicts when 2 people change different parts of
the .config.
Just drop the whole thing, I doubt the timestamp matters much.

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-09-17 17:43   ` Randy.Dunlap
@ 2004-10-16 21:29     ` Sam Ravnborg
  2004-10-16 20:18       ` Roman Zippel
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2004-10-16 21:29 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml, olh, akpm, sam

On Fri, Sep 17, 2004 at 10:43:34AM -0700, Randy.Dunlap wrote:
> 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>

Applied - but I named it KCONFIG_TIMESTAMP so people would not
think that kbuild suddenly stopped checking timestamps.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kconfig: OVERRIDE: save kernel version in .config file
  2004-10-16 20:18       ` Roman Zippel
  2004-10-16 20:29         ` Olaf Hering
@ 2004-10-16 22:27         ` Sam Ravnborg
  1 sibling, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2004-10-16 22:27 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Sam Ravnborg, Randy.Dunlap, lkml, olh, akpm

On Sat, Oct 16, 2004 at 10:18:35PM +0200, Roman Zippel wrote:
> Hi,
> 
> On Sat, 16 Oct 2004, Sam Ravnborg wrote:
> 
> > Applied - but I named it KCONFIG_TIMESTAMP so people would not
> > think that kbuild suddenly stopped checking timestamps.
> 
> That reminds me, I'm not really happy with this patch, it's a hack not a 
> real solution, either we save the timestamp always or not at all, making 
> it dependent on an environment variable is IMO ugly.
> I have a patch which does some tighter checking during config loading, 
> which can be used whether it's needed to write the config. Other front 
> ends could use this as well (e.g. xconfig right now always ask to save
> the config).

The better approach for sure. When we have this in place I will
delete the KCONFIG_NOTIMESTMAP hack.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-16 20:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-17 15:43 kconfig: save kernel version in .config file 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox