diff mbox

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

Message ID 20120417143727.GA2648@herton-Z68MA-D2H-B3
State New
Headers show

Commit Message

Herton Ronaldo Krzesinski April 17, 2012, 2:37 p.m. UTC
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@m1710:~$ rmadison -s lucid-updates linux-meta
> linux-meta | 2.6.32.40.47 | lucid-updates | source

Ok how about this:


If someone doesn't want or doesn't have rmadison installed or rmadison
isn't working at the moment for some reason, we can still specify
manually. Also use the meta package name instead of hardcoding it.

> 
> rtg
> -- 
> Tim Gardner tim.gardner@canonical.com
>

Comments

Herton Ronaldo Krzesinski April 17, 2012, 3:11 p.m. UTC | #1
> diff --git a/meta-source/debian/changelog b/meta-source/debian/changelog
> index 7537177..a1306c2 100644
> --- a/meta-source/debian/changelog
> +++ b/meta-source/debian/changelog
> @@ -1,4 +1,4 @@
> -linux-meta (3.2.0.23.25) precise-proposed; urgency=low
> +linux-meta (3.2.0.23.25) precise; urgency=low
>  
>    * Bump ABI

and just ignore this hunk above, left over from testing...
Tim Gardner April 18, 2012, 1:26 a.m. UTC | #2
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@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.
Herton Ronaldo Krzesinski April 18, 2012, 7:09 p.m. UTC | #3
On Tue, Apr 17, 2012 at 07:26:33PM -0600, Tim Gardner wrote:
> On 04/17/2012 08:37 AM, Herton Ronaldo Krzesinski wrote:
> >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@canonical.com
> 

I applied the change above for our supported -meta branches (with minor
fixes to apply in some cases):

ubuntu-hardy-meta/master
ubuntu-lucid-meta/{ec2,lts-backport-natty,lts-backport-oneiric,master,ports}
ubuntu-natty-meta/{master,ti-omap4}
ubuntu-oneiric-meta/{master,ti-omap4}
ubuntu-precise-meta/{master,ti-omap4}
diff mbox

Patch

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
 
diff --git a/meta-source/debian/changelog b/meta-source/debian/changelog
index 7537177..a1306c2 100644
--- a/meta-source/debian/changelog
+++ b/meta-source/debian/changelog
@@ -1,4 +1,4 @@ 
-linux-meta (3.2.0.23.25) precise-proposed; urgency=low
+linux-meta (3.2.0.23.25) precise; urgency=low
 
   * Bump ABI