[RFC][PATCH] ktl/ubuntu.py: fix series lookup for custom backports

Juerg Haefliger juerg.haefliger at canonical.com
Fri Oct 13 07:55:33 UTC 2017


Currently, only linux-azure is checked against the list of backports.
Relax that check and compare all packages against the list of backports,
and if found, return its target series.

Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
 ktl/ubuntu.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/ktl/ubuntu.py b/ktl/ubuntu.py
index 884ed9765605..0bc2aa182125 100644
--- a/ktl/ubuntu.py
+++ b/ktl/ubuntu.py
@@ -234,16 +234,15 @@ class Ubuntu:
                         retval = entry['name']
                         series_version = entry['series_version']
 
-            # linux-azure is a backport that doesn't contain the 'upstream'
-            # series number on the package name, so we need to look for it
-            # first and then look for the target series.
-            if package.startswith('linux-azure'):
-                for entry in self.db.values():
-                    try:
-                        if len(set(['linux', series_version]) & set(entry['backport-packages'][package])) == 2:
-                            retval = entry['name']
-                    except KeyError:
-                        pass
+            # Check if the package is a 'custom' backport and if so, return
+            # its target series name
+            for entry in self.db.values():
+                try:
+                    if entry['backport-packages'][package] == ['linux', series_version]:
+                        retval = entry['name']
+                        break
+                except KeyError:
+                    pass
 
         return retval
 
-- 
2.14.1





More information about the kernel-team mailing list