[PATCH][kteam-tools] cranky: generate-update-conf: Add leading ~ or + to BACKPORT_SUFFIX

Seth Forshee seth.forshee at canonical.com
Wed Nov 4 22:24:59 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1902957

We currently rely on our packaging to add a ~ character in front
of BACKPORT_SUFFIX in version strings. However we have started
doing forward ports of kernels to the development series as well,
where we want this leading character to be + rather than ~. It's
difficult to figure out which leader is appropriate from our
kernel packaging, whereas when generating update.conf we have the
kernel series info which makes it rather trivial.

Update generate-update-conf to add the leader to BACKPORT_SUFFIX.
This will be a + if the "backport" series is later than the
source series, otherwise it will be a ~.

Signed-off-by: Seth Forshee <seth.forshee at canonical.com>
---
 cranky/fixes.d/generate-update-conf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cranky/fixes.d/generate-update-conf b/cranky/fixes.d/generate-update-conf
index 343ef41b2cea..492d0aa569f9 100755
--- a/cranky/fixes.d/generate-update-conf
+++ b/cranky/fixes.d/generate-update-conf
@@ -61,4 +61,10 @@ print("DEBIAN_MASTER=debian." + master_branch)
 # startnewrelease" will use it to build the new release version
 # following the format "${PARENT_VERSION}~${BACKPORT_SUFFIX}.N":
 if source.backport:
-    print("BACKPORT_SUFFIX={}".format(source.series.name))
+    series = int(source.series.name.replace('.', ''))
+    parent_series = int(parent_source.series.name.replace('.', ''))
+    if series > parent_series:
+        leader = "+"
+    else:
+        leader = "~"
+    print("BACKPORT_SUFFIX={}{}".format(leader, source.series.name))
-- 
2.27.0




More information about the kernel-team mailing list