All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] kbuild: correctly skip tilded backups in localversion files
@ 2007-01-31  7:11 Oleg Verych
  2007-01-31  9:35 ` [patch] update for (kbuild: correctly skip tilded backups in localversion files) Oleg Verych
  2007-01-31 23:56 ` [patch] kbuild: correctly skip tilded backups in localversion files Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Verych @ 2007-01-31  7:11 UTC (permalink / raw)
  To: LKML; +Cc: Roman Zippel, Bastian Blank, Sam Ravnborg, Andrew Morton

kbuild: correctly skip tilded backups in localversion files

 Tildes as in path as in filenames are handled correctly now.

 Definition of `space' was removed, scripts/Kbuild.include has one.
 This definition was taken right from GNU make manual, while Kbuild's
 version is original.

Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Bastian Blank <bastian@waldi.eu.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
---
Another try.

Original report and fix by Bastian Blank:

 The following patch fixes the problem that localversion files where
 ignored if the tree lives in a path which contains a ~. It changes the
 test to apply to the filename only.
 
 Debian allows versions which contains ~ in it. The upstream part of the
 version is in the directory name of the build tree and we got weird
 results because the localversion files was just got ignored in this
 case.

 Makefile |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

--- linux-2.6.20-rc6/Makefile~4tilde-backups~	2007-01-30 23:33:45.781462750 +0100
+++ linux-2.6.20-rc6/Makefile	2007-01-31 07:46:18.696404500 +0100
@@ -777,5 +777,5 @@ $(vmlinux-dirs): prepare scripts
 #	$(localver-full)
 #	  $(localver)
-#	    localversion*		(all localversion* files)
+#	    localversion*		(files, without backups containing '~')
 #	    $(CONFIG_LOCALVERSION)	(from kernel config setting)
 #	  $(localver-auto)		(only if CONFIG_LOCALVERSION_AUTO is set)
@@ -788,14 +788,9 @@ $(vmlinux-dirs): prepare scripts
 # scripts/setlocalversion and add the appropriate checks as needed.
 
-nullstring :=
-space      := $(nullstring) # end of line
-
-___localver = $(objtree)/localversion* $(srctree)/localversion*
-__localver  = $(sort $(wildcard $(___localver)))
-# skip backup files (containing '~')
-_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
-
+localversion = $(objtree)/localversion	    $(srctree)/localversion
+ext_versions = $(objtree)/localversion[^~]* $(srctree)/localversion[!~]*
+versions = $(localversion) $(ext_versions)
 localver = $(subst $(space),, \
-	   $(shell cat /dev/null $(_localver)) \
+	   $(shell cat /dev/null $(sort $(wildcard $(versions)))) \
 	   $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
 

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

* [patch] update for (kbuild: correctly skip tilded backups in localversion files)
  2007-01-31  7:11 [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych
@ 2007-01-31  9:35 ` Oleg Verych
  2007-01-31 23:56 ` [patch] kbuild: correctly skip tilded backups in localversion files Andrew Morton
  1 sibling, 0 replies; 7+ messages in thread
From: Oleg Verych @ 2007-01-31  9:35 UTC (permalink / raw)
  To: LKML; +Cc: Roman Zippel, Bastian Blank, Sam Ravnborg, Andrew Morton

kbuild: finally correctly skip tilded backups in localversion files


Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
---

 Final addition. Why i want to maximize usage of shell, rather, than
 `make'? Just because i think, it's more portable, clear way.

 Thanks.

--- linux-2.6.20-rc6/Makefile~4tilde-backups~	2007-01-31 07:46:18.696404500 +0100
+++ linux-2.6.20-rc6/Makefile	2007-01-31 10:19:18.406100500 +0100
@@ -788,10 +788,10 @@ $(vmlinux-dirs): prepare scripts
 # scripts/setlocalversion and add the appropriate checks as needed.
 
-localversion = $(objtree)/localversion	    $(srctree)/localversion
-ext_versions = $(objtree)/localversion[^~]* $(srctree)/localversion[!~]*
-versions = $(localversion) $(ext_versions)
-localver = $(subst $(space),, \
-	   $(shell cat /dev/null $(sort $(wildcard $(versions)))) \
-	   $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
+pattern = ".*/localversion[^~]*"
+string  = $(shell cat /dev/null \
+	   `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
+
+localver = $(subst $(space),, $(string) \
+			      $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
 
 # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called

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

* Re: [patch] kbuild: correctly skip tilded backups in localversion files
  2007-01-31  7:11 [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych
  2007-01-31  9:35 ` [patch] update for (kbuild: correctly skip tilded backups in localversion files) Oleg Verych
@ 2007-01-31 23:56 ` Andrew Morton
  2007-02-01  2:37   ` Oleg Verych
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2007-01-31 23:56 UTC (permalink / raw)
  To: Oleg Verych; +Cc: LKML, Roman Zippel, Bastian Blank, Sam Ravnborg

On Wed, 31 Jan 2007 07:11:04 +0000
Oleg Verych <olecom@flower.upol.cz> wrote:

> kbuild: correctly skip tilded backups in localversion files

Does this patch replace Bastian's patch, below?


From: Bastian Blank <bastian@waldi.eu.org>

Fix the problem that localversion files were ignored if the tree lives in
a path which contains a ~.  It changes the test to apply to the filename
only.

Debian allows versions which contains ~ in it.  The upstream part of the
version is in the directory name of the build tree and we got weird results
because the localversion files was just got ignored in this case.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 Makefile |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN Makefile~kbuild-dont-ignore-localversion-files-if-the-path-includes-a Makefile
--- a/Makefile~kbuild-dont-ignore-localversion-files-if-the-path-includes-a
+++ a/Makefile
@@ -793,7 +793,7 @@ space      := $(nullstring) # end of lin
 ___localver = $(objtree)/localversion* $(srctree)/localversion*
 __localver  = $(sort $(wildcard $(___localver)))
 # skip backup files (containing '~')
-_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
+_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(notdir $(f))),,$(f)))
 
 localver = $(subst $(space),, \
 	   $(shell cat /dev/null $(_localver)) \
_


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

* Re: [patch] kbuild: correctly skip tilded backups in localversion files
  2007-01-31 23:56 ` [patch] kbuild: correctly skip tilded backups in localversion files Andrew Morton
@ 2007-02-01  2:37   ` Oleg Verych
  2007-02-01  2:43     ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Verych @ 2007-02-01  2:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Roman Zippel, Bastian Blank, Sam Ravnborg

On Wed, Jan 31, 2007 at 03:56:51PM -0800, Andrew Morton wrote:
> On Wed, 31 Jan 2007 07:11:04 +0000
> Oleg Verych <olecom@flower.upol.cz> wrote:
> 
> > kbuild: correctly skip tilded backups in localversion files
> 
> Does this patch replace Bastian's patch, below?

Along with "Message-ID: <20070131093542.GA3471@flower.upol.cz>" -- yes.

Note, that they also make a little bit of cleanup to top makefile's mess,
And, i think, have more elegant, portable, clean solution.

Roman commented on another my patch, saying, that tilde in the end isn't
the only way to name backups. Filename, containing '~' is a backup in the
sources, thus i'm proposing new patch.

Unfortunately still no more comments from anybody. Roman joined, but
seems busy now, to comment on such minor stuff.

Anyway, thanks.


> From: Bastian Blank <bastian@waldi.eu.org>
> 
> Fix the problem that localversion files were ignored if the tree lives in
> a path which contains a ~.  It changes the test to apply to the filename
> only.
> 
> Debian allows versions which contains ~ in it.  The upstream part of the
> version is in the directory name of the build tree and we got weird results
> because the localversion files was just got ignored in this case.
> 
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Roman Zippel <zippel@linux-m68k.org>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  Makefile |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff -puN Makefile~kbuild-dont-ignore-localversion-files-if-the-path-includes-a Makefile
> --- a/Makefile~kbuild-dont-ignore-localversion-files-if-the-path-includes-a
> +++ a/Makefile
> @@ -793,7 +793,7 @@ space      := $(nullstring) # end of lin
>  ___localver = $(objtree)/localversion* $(srctree)/localversion*
>  __localver  = $(sort $(wildcard $(___localver)))
>  # skip backup files (containing '~')
> -_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
> +_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(notdir $(f))),,$(f)))
>  
>  localver = $(subst $(space),, \
>  	   $(shell cat /dev/null $(_localver)) \
> _
> 

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

* Re: [patch] kbuild: correctly skip tilded backups in localversion files
  2007-02-01  2:37   ` Oleg Verych
@ 2007-02-01  2:43     ` Andrew Morton
  2007-02-01 15:59       ` 2.6.20-rc7 (Re: [patch] kbuild: correctly skip tilded backups in localversion files) Oleg Verych
  2007-02-04 14:01       ` [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Morton @ 2007-02-01  2:43 UTC (permalink / raw)
  To: Oleg Verych; +Cc: LKML, Roman Zippel, Bastian Blank, Sam Ravnborg

On Thu, 1 Feb 2007 03:37:17 +0100 Oleg Verych <olecom@flower.upol.cz> wrote:

> On Wed, Jan 31, 2007 at 03:56:51PM -0800, Andrew Morton wrote:
> > On Wed, 31 Jan 2007 07:11:04 +0000
> > Oleg Verych <olecom@flower.upol.cz> wrote:
> > 
> > > kbuild: correctly skip tilded backups in localversion files
> > 
> > Does this patch replace Bastian's patch, below?
> 
> Along with "Message-ID: <20070131093542.GA3471@flower.upol.cz>" -- yes.
> 

OK.  Just to avoid mistakes, can you please resend everything, against
2.6.20-rc7?

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

* 2.6.20-rc7 (Re: [patch] kbuild: correctly skip tilded backups in localversion files)
  2007-02-01  2:43     ` Andrew Morton
@ 2007-02-01 15:59       ` Oleg Verych
  2007-02-04 14:01       ` [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych
  1 sibling, 0 replies; 7+ messages in thread
From: Oleg Verych @ 2007-02-01 15:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Roman Zippel, Bastian Blank, Sam Ravnborg

kbuild: correctly skip tilded backups in localversion files

 Tildes as in path as in filenames are handled correctly now:
 only files, containing tilde '~', are backups, thus are not valid.

 [KJ]:
 Definition of `space' was removed, scripts/Kbuild.include has one.
 This definition was taken right from GNU make manual, while Kbuild's
 version is original.

Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Bastian Blank <bastian@waldi.eu.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
---

 My using of the `sh' rides from willing to have more portable,
 understandable implementation (and due to GFDL make's docs ;)

Original report by Bastian Blank:

 The following patch fixes the problem that localversion files where
 ignored if the tree lives in a path which contains a ~. It changes the
 test to apply to the filename only.
 
 Debian allows versions which contains ~ in it. The upstream part of the
 version is in the directory name of the build tree and we got weird
 results because the localversion files was just got ignored in this
 case.

---
 linux-2.6.20-rc7/Makefile |   17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

Index: kernel.org/linux-2.6.20-rc7/Makefile
===================================================================
--- kernel.org.orig/linux-2.6.20-rc7/Makefile	2007-02-01 16:20:54.214174250 +0100
+++ kernel.org/linux-2.6.20-rc7/Makefile	2007-02-01 16:21:40.649076250 +0100
@@ -777,5 +777,5 @@ $(vmlinux-dirs): prepare scripts
 #	$(localver-full)
 #	  $(localver)
-#	    localversion*		(all localversion* files)
+#	    localversion*		(files without backups, containing '~')
 #	    $(CONFIG_LOCALVERSION)	(from kernel config setting)
 #	  $(localver-auto)		(only if CONFIG_LOCALVERSION_AUTO is set)
@@ -788,15 +788,10 @@ $(vmlinux-dirs): prepare scripts
 # scripts/setlocalversion and add the appropriate checks as needed.
 
-nullstring :=
-space      := $(nullstring) # end of line
+pattern = ".*/localversion[^~]*"
+string  = $(shell cat /dev/null \
+	   `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
 
-___localver = $(objtree)/localversion* $(srctree)/localversion*
-__localver  = $(sort $(wildcard $(___localver)))
-# skip backup files (containing '~')
-_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
-
-localver = $(subst $(space),, \
-	   $(shell cat /dev/null $(_localver)) \
-	   $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
+localver = $(subst $(space),, $(string) \
+			      $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
 
 # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called

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

* Re: [patch] kbuild: correctly skip tilded backups in localversion files
  2007-02-01  2:43     ` Andrew Morton
  2007-02-01 15:59       ` 2.6.20-rc7 (Re: [patch] kbuild: correctly skip tilded backups in localversion files) Oleg Verych
@ 2007-02-04 14:01       ` Oleg Verych
  1 sibling, 0 replies; 7+ messages in thread
From: Oleg Verych @ 2007-02-04 14:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

On Wed, Jan 31, 2007 at 06:43:29PM -0800, Andrew Morton wrote:
> On Thu, 1 Feb 2007 03:37:17 +0100 Oleg Verych <olecom@flower.upol.cz> wrote:
> 
> > On Wed, Jan 31, 2007 at 03:56:51PM -0800, Andrew Morton wrote:
> > > On Wed, 31 Jan 2007 07:11:04 +0000
> > > Oleg Verych <olecom@flower.upol.cz> wrote:
> > > 
> > > > kbuild: correctly skip tilded backups in localversion files
> > > 
> > > Does this patch replace Bastian's patch, below?
> > 
> > Along with "Message-ID: <20070131093542.GA3471@flower.upol.cz>" -- yes.
> > 
> 
> OK.  Just to avoid mistakes, can you please resend everything, against
> 2.6.20-rc7?

I've resent patches, that i wanted to be in -mm, even without anyone,
who can ack or even test them. But it seems, they not made it to lkml.

____

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

end of thread, other threads:[~2007-02-04 13:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31  7:11 [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych
2007-01-31  9:35 ` [patch] update for (kbuild: correctly skip tilded backups in localversion files) Oleg Verych
2007-01-31 23:56 ` [patch] kbuild: correctly skip tilded backups in localversion files Andrew Morton
2007-02-01  2:37   ` Oleg Verych
2007-02-01  2:43     ` Andrew Morton
2007-02-01 15:59       ` 2.6.20-rc7 (Re: [patch] kbuild: correctly skip tilded backups in localversion files) Oleg Verych
2007-02-04 14:01       ` [patch] kbuild: correctly skip tilded backups in localversion files Oleg Verych

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.