[Unstable][PATCH] UBUNTU: [Packaging] Replace Perl oneliner with Bash statements

Juerg Haefliger juerg.haefliger at canonical.com
Mon Nov 1 09:16:14 UTC 2021


Replace the only Perl oneliner in the Ubuntu Makefiles with Bash
statements. This brings us one step closer to dropping Perl as a build
dependency for the Ubuntu kernel.

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian/rules.d/1-maintainer.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 8216524fbd18..7c13fcdaa98a 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -143,8 +143,12 @@ startnewrelease:
 			ver="$${ver%.*}.$$(( $${prev_ver##*.} +1 ))"; \
 		fi; \
 	else \
-		ver="$(release)-$$(echo "$(revision)" | \
-			perl -ne 'if (/^(\d*)\.(\d*)(.*)?$$/) { printf("%d.%d%s\n", $$1 + 1, $$2 +1, $$3) }')"; \
+		rev=$(revision); \
+		suffix=$$(echo "$${rev}" | sed 's/^[0-9]*\.[0-9]*//'); \
+		abi=$${rev%%.*}; \
+		upload=$${rev#*.}; \
+		upload=$${upload%$${suffix}}; \
+		ver=$(release)-$$((abi + 1)).$$((upload + 1))$${suffix}; \
 	fi; \
 	now="$(shell date -R)"; \
 	echo "Creating new changelog set for $$ver..."; \
-- 
2.30.2




More information about the kernel-team mailing list