From 63da784de86a85dfa9b30e415b460197eb54a8a5 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 6 Sep 2021 00:45:08 +0200 Subject: upgrade: fix problem with upgrading versioned libraries Apply heuristics to generate base names of versioned libraries. --- scripts/upgrade.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade.py b/scripts/upgrade.py index 3de6ee6..a3fd909 100644 --- a/scripts/upgrade.py +++ b/scripts/upgrade.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 +import re import sys import time import pylxd @@ -115,12 +116,17 @@ class Container: print("_package_set_from_str ", type(s)) old_list = s.split('\n') old_packages = [] + pat = re.compile(r'([\w\.\-]*?)[0-9][0-9a-f\.\-]*') i = 1 for l in old_list: i = i + 1 res = l.split(' ') if len(res) == 3: (name, _, version) = res + if name.startswith('lib'): + m = pat.match(name) + if m: + name = m[1] old_packages.append(name) return frozenset(old_packages) -- cgit v1.2.3