Skip to contentSkip to conversation

kconfig: fix the failure of `make rpm-pkg` after localversion file changed

PATCH In review Adam Lee 1 participant 2 messages Nov 4, 2012 – Feb 18, 2013 Kbuild

lore
Share & tools
lore

Adam Lee

author
#0 lore raw

PATCH 1/1 kconfig: fix the failure of `make rpm-pkg` after localversion file changed

make rpm-pkg and make binrpm-pkg will write $KERNELRELEASE into rpm spec files which don't depend on localversion file now. So, the unchanged spec files will cause failure after localversion file changed.

I added the localversion file into the dependencies of spec files. Because that file is not necessary, I made it a empty target, so its last-modification time will be checked by Make only when it exists.

---
 scripts/package/Makefile |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/package/Makefile +5 -2
index 87bf080..a7c1f59 100644
@@ -30,9 +30,12 @@ KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
 MKSPEC     := $(srctree)/scripts/package/mkspec
 PREV       := set -e; cd -P ..;
 
+# localversion, its last-modification time will be checked only when it exists
+localversion:
+
 # rpm-pkg
 # ---------------------------------------------------------------------------
-$(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
+$(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile localversion
 	$(CONFIG_SHELL) $(MKSPEC) > $@
 
 rpm-pkg rpm: $(objtree)/kernel.spec FORCE
@@ -60,7 +63,7 @@ clean-files := $(objtree)/kernel.spec
 
 # binrpm-pkg
 # ---------------------------------------------------------------------------
-$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
+$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile localversion
 	$(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
 
 binrpm-pkg: $(objtree)/binkernel.spec FORCE
Signature · 1 line
1.7.10.4
author
#1 lore raw
Quoted 4 lines · Adam Lee

make rpm-pkg and make binrpm-pkg will write $KERNELRELEASE into rpm spec files which don't depend on localversion file now. So, the unchanged spec files will cause failure after localversion file changed.

Quoted 8 lines

I added the localversion file into the dependencies of spec files. Because that file is not necessary, I made it a empty target, so its last-modification time will be checked by Make only when it exists.

---
 scripts/package/Makefile |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Hi, Michal

Any comment about my fix?

reproduce steps:
1, make rpm-pkg
2, change localversion
3, make rpm-pkg

Signature · 3 lines
Regards,
Adam Lee
http://adam8157.info