summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2021-09-06 00:45:08 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2021-09-06 00:45:08 +0200
commit63da784de86a85dfa9b30e415b460197eb54a8a5 (patch)
tree9c5ce0416770f650b26b57c0a6cb0e2c44e11291
parent7975047fbf3ec3a7e43cad704ea0ba891662dd99 (diff)
upgrade: fix problem with upgrading versioned libraries
Apply heuristics to generate base names of versioned libraries.
-rw-r--r--scripts/upgrade.py6
1 files changed, 6 insertions, 0 deletions
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)