Commit 76c32956 authored by Oleg Verych's avatar Oleg Verych Committed by Linus Torvalds

[PATCH] 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.
 That definition was taken right from the 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: default avatarOleg Verych <olecom@flower.upol.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5de043f4
...@@ -776,7 +776,7 @@ $(vmlinux-dirs): prepare scripts ...@@ -776,7 +776,7 @@ $(vmlinux-dirs): prepare scripts
# $(EXTRAVERSION) eg, -rc6 # $(EXTRAVERSION) eg, -rc6
# $(localver-full) # $(localver-full)
# $(localver) # $(localver)
# localversion* (all localversion* files) # localversion* (files without backups, containing '~')
# $(CONFIG_LOCALVERSION) (from kernel config setting) # $(CONFIG_LOCALVERSION) (from kernel config setting)
# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set)
# ./scripts/setlocalversion (SCM tag, if one exists) # ./scripts/setlocalversion (SCM tag, if one exists)
...@@ -787,17 +787,12 @@ $(vmlinux-dirs): prepare scripts ...@@ -787,17 +787,12 @@ $(vmlinux-dirs): prepare scripts
# moment, only git is supported but other SCMs can edit the script # moment, only git is supported but other SCMs can edit the script
# scripts/setlocalversion and add the appropriate checks as needed. # scripts/setlocalversion and add the appropriate checks as needed.
nullstring := pattern = ".*/localversion[^~]*"
space := $(nullstring) # end of line string = $(shell cat /dev/null \
`find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
___localver = $(objtree)/localversion* $(srctree)/localversion* localver = $(subst $(space),, $(string) \
__localver = $(sort $(wildcard $(___localver))) $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
# skip backup files (containing '~')
_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
localver = $(subst $(space),, \
$(shell cat /dev/null $(_localver)) \
$(patsubst "%",%,$(CONFIG_LOCALVERSION)))
# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
# and if the SCM is know a tag from the SCM is appended. # and if the SCM is know a tag from the SCM is appended.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment