diff options
author | Oleg Verych <olecom@flower.upol.cz> | 2007-02-05 20:18:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-06 17:30:49 -0500 |
commit | 76c329563c5b8663ef27eb1bd195885ab826cbd0 (patch) | |
tree | 65052ff17cc0462ddab5dfa0bc22c08d33589e07 /Makefile | |
parent | 5de043f4bd11a9e0a3e8daec7d1905da575a76b7 (diff) |
[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: Oleg Verych <olecom@flower.upol.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -776,7 +776,7 @@ $(vmlinux-dirs): prepare scripts | |||
776 | # $(EXTRAVERSION) eg, -rc6 | 776 | # $(EXTRAVERSION) eg, -rc6 |
777 | # $(localver-full) | 777 | # $(localver-full) |
778 | # $(localver) | 778 | # $(localver) |
779 | # localversion* (all localversion* files) | 779 | # localversion* (files without backups, containing '~') |
780 | # $(CONFIG_LOCALVERSION) (from kernel config setting) | 780 | # $(CONFIG_LOCALVERSION) (from kernel config setting) |
781 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) | 781 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) |
782 | # ./scripts/setlocalversion (SCM tag, if one exists) | 782 | # ./scripts/setlocalversion (SCM tag, if one exists) |
@@ -787,17 +787,12 @@ $(vmlinux-dirs): prepare scripts | |||
787 | # moment, only git is supported but other SCMs can edit the script | 787 | # moment, only git is supported but other SCMs can edit the script |
788 | # scripts/setlocalversion and add the appropriate checks as needed. | 788 | # scripts/setlocalversion and add the appropriate checks as needed. |
789 | 789 | ||
790 | nullstring := | 790 | pattern = ".*/localversion[^~]*" |
791 | space := $(nullstring) # end of line | 791 | string = $(shell cat /dev/null \ |
792 | `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`) | ||
792 | 793 | ||
793 | ___localver = $(objtree)/localversion* $(srctree)/localversion* | 794 | localver = $(subst $(space),, $(string) \ |
794 | __localver = $(sort $(wildcard $(___localver))) | 795 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) |
795 | # skip backup files (containing '~') | ||
796 | _localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f))) | ||
797 | |||
798 | localver = $(subst $(space),, \ | ||
799 | $(shell cat /dev/null $(_localver)) \ | ||
800 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) | ||
801 | 796 | ||
802 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called | 797 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called |
803 | # and if the SCM is know a tag from the SCM is appended. | 798 | # and if the SCM is know a tag from the SCM is appended. |