[xenial][PATCH] UBUNTU: [Debian] Support custom and lts kernels in printchanges/insertchanges

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[xenial][PATCH] UBUNTU: [Debian] Support custom and lts kernels in printchanges/insertchanges

Marcelo Henrique Cerri
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 <[hidden email]>
---
 debian/rules.d/1-maintainer.mk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 0c579c85195e..d469fc2331b7 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -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)
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/cmnt: [xenial][PATCH] UBUNTU: [Debian] Support custom and lts kernels in printchanges/insertchanges

Kleber Souza

On 06/30/17 15:03, Marcelo Henrique Cerri wrote:

> 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 <[hidden email]>
> ---
>  debian/rules.d/1-maintainer.mk | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> index 0c579c85195e..d469fc2331b7 100644
> --- a/debian/rules.d/1-maintainer.mk
> +++ b/debian/rules.d/1-maintainer.mk
> @@ -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)
>

This seems to work well for both derivatives and backports.

My only comment is that I'm in favor of applying this patch as well on
all series we currently support. This will cause a conflict when we do
the rebase for some derivatives (for instance yakkety/raspi2 which looks
for ' Ubuntu-raspi2-' on git log), but that would a one-time only
conflict resolution.


Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [xenial][PATCH] UBUNTU: [Debian] Support custom and lts kernels in printchanges/insertchanges

Kleber Souza
In reply to this post by Marcelo Henrique Cerri
Applied to xenial/master-next branch, assuming the ACK also from Stefan
and Seth from the patches for the other series.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team