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

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Tue Apr 17 14:37:28 UTC 2012


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
 
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
 

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 at canonical.com
> 

-- 
[]'s
Herton




More information about the kernel-team mailing list