]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] Support custom and lts kernels in printchanges/insertchanges
authorMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 10 Jul 2017 13:46:54 +0000 (10:46 -0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 17 Jul 2017 14:39:03 +0000 (16:39 +0200)
Ignore: yes

Currently printchanges/insertchanges do not work for custom kernels
because commit messages for each release follow the format
"UBUNTU: Ubuntu-${flavour}-${prev_fullver}" instead of
"UBUNTU: Ubuntu-${prev_fullver}". Also, for the first release, the
previous version in the changelog does not match the version in the
previous release commit.

This patch makes the base commit selection more flexible, allowing
commit messages in the format "UBUNTU: Ubuntu-*${prev_fullver}" and it
fallbacks to the latest release commit when a exact match is not found
in order to support the custom kernels in their initial releases.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
debian/rules.d/1-maintainer.mk

index 0c579c85195e2d114ffb2696c21966cba03ca640..d469fc2331b7f0e96a8f19c75905b5f77638a3f2 100644 (file)
@@ -97,9 +97,14 @@ printenv:
 
 printchanges:
        @baseCommit=$$(git log --pretty=format:'%H %s' | \
-               gawk '/UBUNTU: '".*Ubuntu-`echo $(prev_fullver) | sed 's/+/\\\\+/'`"'$$/ { print $$1; exit }'); \
-               git log "$$baseCommit"..HEAD | \
-               $(DROOT)/scripts/misc/git-ubuntu-log $(ubuntu_log_opts)
+               gawk '/UBUNTU: '".*Ubuntu-.*`echo $(prev_fullver) | sed 's/+/\\\\+/'`"'(~.*)?$$/ { print $$1; exit }'); \
+       if [ -z "$$baseCommit" ]; then \
+               echo "WARNING: couldn't find a commit for the previous version. Using the lastest one." >&2; \
+               baseCommit=$$(git log --pretty=format:'%H %s' | \
+                       gawk '/UBUNTU:\s*Ubuntu-.*$$/ { print $$1; exit }'); \
+       fi; \
+       git log "$$baseCommit"..HEAD | \
+       $(DROOT)/scripts/misc/git-ubuntu-log $(ubuntu_log_opts)
 
 insertchanges: autoreconstruct
        @perl -w -f $(DROOT)/scripts/misc/insert-changes.pl $(DROOT) $(DEBIAN)