diff options
| -rw-r--r-- | Makefile | 16 | ||||
| -rw-r--r-- | scripts/package/Makefile | 3 |
2 files changed, 13 insertions, 6 deletions
| @@ -904,12 +904,18 @@ localver = $(subst $(space),, $(string) \ | |||
| 904 | # and if the SCM is know a tag from the SCM is appended. | 904 | # and if the SCM is know a tag from the SCM is appended. |
| 905 | # The appended tag is determined by the SCM used. | 905 | # The appended tag is determined by the SCM used. |
| 906 | # | 906 | # |
| 907 | # Currently, only git is supported. | 907 | # .scmversion is used when generating rpm packages so we do not loose |
| 908 | # Other SCMs can edit scripts/setlocalversion and add the appropriate | 908 | # the version information from the SCM when we do the build of the kernel |
| 909 | # checks as needed. | 909 | # from the copied source |
| 910 | ifdef CONFIG_LOCALVERSION_AUTO | 910 | ifdef CONFIG_LOCALVERSION_AUTO |
| 911 | _localver-auto = $(shell $(CONFIG_SHELL) \ | 911 | |
| 912 | $(srctree)/scripts/setlocalversion $(srctree)) | 912 | ifeq ($(wildcard .scmversion),) |
| 913 | _localver-auto = $(shell $(CONFIG_SHELL) \ | ||
| 914 | $(srctree)/scripts/setlocalversion $(srctree)) | ||
| 915 | else | ||
| 916 | _localver-auto = $(shell cat .scmversion 2> /dev/null) | ||
| 917 | endif | ||
| 918 | |||
| 913 | localver-auto = $(LOCALVERSION)$(_localver-auto) | 919 | localver-auto = $(LOCALVERSION)$(_localver-auto) |
| 914 | endif | 920 | endif |
| 915 | 921 | ||
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 8c6b7b09606a..fa4a0a17b7e0 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
| @@ -35,9 +35,10 @@ $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile | |||
| 35 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE | 35 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE |
| 36 | $(MAKE) clean | 36 | $(MAKE) clean |
| 37 | $(PREV) ln -sf $(srctree) $(KERNELPATH) | 37 | $(PREV) ln -sf $(srctree) $(KERNELPATH) |
| 38 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion | ||
| 38 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. | 39 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. |
| 39 | $(PREV) rm $(KERNELPATH) | 40 | $(PREV) rm $(KERNELPATH) |
| 40 | 41 | rm -f $(objtree)/.scmversion | |
| 41 | set -e; \ | 42 | set -e; \ |
| 42 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version | 43 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version |
| 43 | set -e; \ | 44 | set -e; \ |
