[P,T,X,A,B,C,D] UBUNTU: [Packaging] startnewrelease: add support for backport kernels

Message ID 20180920073602.2400-1-marcelo.cerri@canonical.com
State New
Headers show
Series
  • [P,T,X,A,B,C,D] UBUNTU: [Packaging] startnewrelease: add support for backport kernels
Related show

Commit Message

Marcelo Henrique Cerri Sept. 20, 2018, 7:36 a.m.
BugLink: http://bugs.launchpad.net/bugs/1793461

Update the startnewrelease target to support backport version numbers
when creating the new changelog entry.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 debian/rules.d/1-maintainer.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Thadeu Lima de Souza Cascardo Sept. 20, 2018, 8:05 a.m. | #1
On Thu, Sep 20, 2018 at 04:36:02AM -0300, Marcelo Henrique Cerri wrote:
> BugLink: http://bugs.launchpad.net/bugs/1793461
> 
> Update the startnewrelease target to support backport version numbers
> when creating the new changelog entry.
> 
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  debian/rules.d/1-maintainer.mk | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> index 1f592e53f78f..5d759f6e1e0a 100644
> --- a/debian/rules.d/1-maintainer.mk
> +++ b/debian/rules.d/1-maintainer.mk
> @@ -125,11 +125,10 @@ diffupstream:
>  
>  startnewrelease:
>  	dh_testdir
> -	@nextminor=$(shell expr `echo $(revision) | gawk -F. '{print $$2}'` + 1); \
> -	nextmajor=$(shell expr `echo $(revision) | awk -F. '{print $$1}'` + 1); \
> +	@ver=$$(echo "$(revision)" | perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }'); \
>  	now="$(shell date -R)"; \
> -	echo "Creating new changelog set for $(release)-$$nextmajor.$$nextminor..."; \
> -	echo -e "$(src_pkg_name) ($(release)-$$nextmajor.$$nextminor) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
> +	echo "Creating new changelog set for $(release)-$$ver..."; \
> +	echo -e "$(src_pkg_name) ($(release)-$$ver) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
>  	echo "  CHANGELOG: Do not edit directly. Autogenerated at release." >> \
>  		$(DEBIAN)/changelog.new; \
>  	echo "  CHANGELOG: Use the printchanges target to see the curent changes." \
> -- 
> 2.17.1

Patch does not apply to precise, but it's not needed there, as it doesn't have
any backports. If we still want to apply it, it should be easy to work around
it.

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Seth Forshee Sept. 20, 2018, 8:31 a.m. | #2
On Thu, Sep 20, 2018 at 04:36:02AM -0300, Marcelo Henrique Cerri wrote:
> BugLink: http://bugs.launchpad.net/bugs/1793461
> 
> Update the startnewrelease target to support backport version numbers
> when creating the new changelog entry.
> 
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>

Acked-by: Seth Forshee <seth.forshee@canonical.com>

Applied to cosmic/master-next and unstable/master, thanks!
Kleber Souza Sept. 20, 2018, 9:57 a.m. | #3
On 09/20/18 09:36, Marcelo Henrique Cerri wrote:
> BugLink: http://bugs.launchpad.net/bugs/1793461
> 
> Update the startnewrelease target to support backport version numbers
> when creating the new changelog entry.
> 
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  debian/rules.d/1-maintainer.mk | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> index 1f592e53f78f..5d759f6e1e0a 100644
> --- a/debian/rules.d/1-maintainer.mk
> +++ b/debian/rules.d/1-maintainer.mk
> @@ -125,11 +125,10 @@ diffupstream:
>  
>  startnewrelease:
>  	dh_testdir
> -	@nextminor=$(shell expr `echo $(revision) | gawk -F. '{print $$2}'` + 1); \
> -	nextmajor=$(shell expr `echo $(revision) | awk -F. '{print $$1}'` + 1); \
> +	@ver=$$(echo "$(revision)" | perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }'); \
>  	now="$(shell date -R)"; \
> -	echo "Creating new changelog set for $(release)-$$nextmajor.$$nextminor..."; \
> -	echo -e "$(src_pkg_name) ($(release)-$$nextmajor.$$nextminor) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
> +	echo "Creating new changelog set for $(release)-$$ver..."; \
> +	echo -e "$(src_pkg_name) ($(release)-$$ver) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
>  	echo "  CHANGELOG: Do not edit directly. Autogenerated at release." >> \
>  		$(DEBIAN)/changelog.new; \
>  	echo "  CHANGELOG: Use the printchanges target to see the curent changes." \
> 

Applied to {precise-esm,trusty,xenial,bionic}/master-next branches, with
a context adjustment for precise-esm. *Not* applied for artful.

Thanks,
Kleber

Patch

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 1f592e53f78f..5d759f6e1e0a 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -125,11 +125,10 @@  diffupstream:
 
 startnewrelease:
 	dh_testdir
-	@nextminor=$(shell expr `echo $(revision) | gawk -F. '{print $$2}'` + 1); \
-	nextmajor=$(shell expr `echo $(revision) | awk -F. '{print $$1}'` + 1); \
+	@ver=$$(echo "$(revision)" | perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }'); \
 	now="$(shell date -R)"; \
-	echo "Creating new changelog set for $(release)-$$nextmajor.$$nextminor..."; \
-	echo -e "$(src_pkg_name) ($(release)-$$nextmajor.$$nextminor) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
+	echo "Creating new changelog set for $(release)-$$ver..."; \
+	echo -e "$(src_pkg_name) ($(release)-$$ver) UNRELEASED; urgency=medium\n" > $(DEBIAN)/changelog.new; \
 	echo "  CHANGELOG: Do not edit directly. Autogenerated at release." >> \
 		$(DEBIAN)/changelog.new; \
 	echo "  CHANGELOG: Use the printchanges target to see the curent changes." \