ACK: Allow passing version for dpkg-genchanges to dpkg-buildpackage for -meta

Tim Gardner tim.gardner at canonical.com
Wed Apr 18 01:26:33 UTC 2012


On 04/17/2012 08:37 AM, Herton Ronaldo Krzesinski wrote:
> On Mon, Apr 16, 2012 at 07:36:58PM -0600, Tim Gardner wrote:
>> On 04/16/2012 12:30 PM, Herton Ronaldo Krzesinski wrote:
>>> When doing stable updates, we sometimes have cases where we need to
>>> include more than one changelog entry on meta packages, for example, we
>>> do one release to -proposed, this doesn't end up in updates, another
>>> release/abi bump happens, and we must include 2 changelog entries for
>>> the packages that will go to updates.
>>>
>>> Following this is the proposed changes for hardy and the rest of meta
>>> packages (lucid and everything supported until precise/q). It changes
>>> the Makefile so one can easily specify the previous version so we can
>>> tune the changelog generation as needed. It's a simple change, one could
>>> always specify the -v manually, but since we already have a Makefile
>>> that does everything... why not.
>>>
>>
>> If you're going that far, then why not make it automagic. Use
>> rmadison to extract the current version in updates, e.g.,
>>
>> rtg at m1710:~$ rmadison -s lucid-updates linux-meta
>> linux-meta | 2.6.32.40.47 | lucid-updates | source
>
> Ok how about this:
>
> diff --git a/Makefile b/Makefile
> index 0d18f4a..fc0b59f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,20 +1,30 @@
>   LOG		:= meta-source/debian/changelog
> -META_VERSION	:= $(shell head -1 $(LOG)|sed 's/.*(\(.*\)).*/\1/')
> +META_NAME	:= $(shell head -n 1 $(LOG) | sed 's/\(.*\)[[:space:]]\+(.*).*/\1/')
> +META_VERSION	:= $(shell head -n 1 $(LOG) | sed 's/.*(\(.*\)).*/\1/')
> +META_SERIES	:= $(shell head -n 1 $(LOG) | sed 's/.*(.*)[[:space:]]\+\(.*\);.*/\1/' | sed 's/-.*//')
> +LAST_VERSION	?= $(shell rmadison -a source -s $(META_SERIES)-updates $(META_NAME) | cut -d '|' -f 2 | tr -d '[:blank:]')
> +
> +ifeq ($(LAST_VERSION),)
> +LAST_VERSION	:= $(shell rmadison -a source -s $(META_SERIES) $(META_NAME) | cut -d '|' -f 2 | tr -d '[:blank:]')
> +ifeq ($(LAST_VERSION),)
> +LAST_VERSION	:= $(META_VERSION)
> +endif
> +endif
>
>   all: source
>
>   source: clean
> -	ln -s meta-source linux-meta-$(META_VERSION)
> -	cd linux-meta-$(META_VERSION); \
> -	dpkg-buildpackage -S -sa -rfakeroot -I.git -I.gitignore -i'\.git.*'
> +	ln -s meta-source $(META_NAME)-$(META_VERSION)
> +	cd $(META_NAME)-$(META_VERSION); \
> +	dpkg-buildpackage -S -sa -rfakeroot -I.git -I.gitignore -i'\.git.*' -v$(LAST_VERSION)
>
>   binary: clean
> -	ln -s meta-source linux-meta-$(META_VERSION)
> -	cd linux-meta-$(META_VERSION); \
> +	ln -s meta-source $(META_NAME)-$(META_VERSION)
> +	cd $(META_NAME)-$(META_VERSION); \
>   	debuild -b
>
>   clean:
>   	cd meta-source&&  fakeroot debian/rules clean
> -	rm -f linux-meta-$(META_VERSION)
> +	rm -f $(META_NAME)-$(META_VERSION)
>   	rm -f *.dsc *.changes *.gz *.deb *.build *.upload
>

Looks good to me.
-- 
Tim Gardner tim.gardner at canonical.com




More information about the kernel-team mailing list