Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #58919

Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.debian.kernel
Subject Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function
Date 2017-09-14 13:50 +0200
Message-ID <upAOC-4uy-17@gated-at.bofh.it> (permalink)
References <uf4Gm-6q1-33@gated-at.bofh.it> <un8MN-35Q-9@gated-at.bofh.it> <unu0W-Sv-21@gated-at.bofh.it> <uouLg-2jC-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2017-09-11 19:48 GMT+09:00 Riku Voipio <riku.voipio@linaro.org>:
> On 8 September 2017 at 18:40, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> 2017-09-08 2:04 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
>>> Hi Riku,
>>>
>>>
>>> 2017-08-16 20:08 GMT+09:00  <riku.voipio@linaro.org>:
>>>> From: Riku Voipio <riku.voipio@linaro.org>
>>>>
>>>> The updated deb-pkg and bindeb-pkg will use the same snippet,
>>>> so make it reusable.
>>>>
>>>> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
>>>> ---
>>>>  scripts/package/Makefile | 12 +++++++-----
>>>>  1 file changed, 7 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
>>>> index 71b4a8af9d4d..9867638896ad 100644
>>>> --- a/scripts/package/Makefile
>>>> +++ b/scripts/package/Makefile
>>>> @@ -44,14 +44,18 @@ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
>>>>         $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \
>>>>  rm -f $(2) $(objtree)/.scmversion
>>>>
>>>> +quiet_cmd_updateversion = UPDATEVERSION
>>>> +      cmd_updateversion = \
>>>> +       $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version; \
>>>> +       mv -f $(objtree)/.tmp_version $(objtree)/.version
>>>> +
>>>>  # rpm-pkg
>>>>  # ---------------------------------------------------------------------------
>>>>  rpm-pkg rpm: FORCE
>>>>         $(MAKE) clean
>>>>         $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
>>>>         $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
>>>> -       $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
>>>> -       mv -f $(objtree)/.tmp_version $(objtree)/.version
>>>> +       $(call cmd,updateversion)
>>>>         rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
>>>>         rm $(KERNELPATH).tar.gz kernel.spec
>>>>
>>>> @@ -60,9 +64,7 @@ rpm-pkg rpm: FORCE
>>>>  binrpm-pkg: FORCE
>>>>         $(MAKE) KBUILD_SRC=
>>>>         $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
>>>> -       $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
>>>> -       mv -f $(objtree)/.tmp_version $(objtree)/.version
>>>> -
>>>> +       $(call cmd,updateversion)
>>>>         rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
>>>>                 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec
>>>>         rm binkernel.spec
>>>
>>>
>>>
>>> scripts/mkversion is pretty small.
>>> I think scripts/mkversion can also update .version
>>>
>>> For example,
>>>
>>>
>>>
>>>
>>> if [ ! -f .version ]
>>> then
>>>     version=1
>>> else
>>>     version=$(expr 0$(cat .version) + 1)
>>> fi
>>>
>>> echo $version > .version
>>> echo $version
>>>
>>>
>>>
>>>
>>> Then, remove the duplicated code from the Makefile.
>>
>>
>>
>> Sorry, please let me think about this carefully.
>>
>> We have simliar code in
>> scripts/link-vmlinux.sh and scripts/mkversion
>
> Oh. Looking deeper, running "make binrpm" twice in a row incrediments
> the .version with two. I think we can leave updating version to
> link-mklinux and drop updating .version from
> scripts/packaging/Makefile. The actual use of mkversion is then to
> predict the next version, and we can stop using .version directly in
> builddeb since the build will outdate it.
>

Even worse, the spec file claims a different number from
the one embedded in the kernel image
(for both rpm-pkg and binrpm-pkg).

I sent a patch.  Seems working as far as I tested.





-- 
Best Regards
Masahiro Yamada

Back to linux.debian.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] scripts/package/Makefile: make revision update a function riku.voipio@linaro.org - 2017-08-16 13:30 +0200
  Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-07 19:30 +0200
    Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-08 18:10 +0200
      Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function Riku Voipio <riku.voipio@linaro.org> - 2017-09-11 13:10 +0200
        Re: [PATCH 1/2] scripts/package/Makefile: make revision update a function Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-14 13:50 +0200

csiph-web