summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2021-06-18 11:18:10 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2021-06-18 11:18:34 +0200
commite374d7b18bf629b8308e23c147b8631b6d54e4a6 (patch)
treead137f80387b6d3887cbb00f4ae1843053ee5175
parent7975047fbf3ec3a7e43cad704ea0ba891662dd99 (diff)
WIP: package replacementspackage-replacements
-rw-r--r--scripts/upgrade.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/upgrade.py b/scripts/upgrade.py
index 3de6ee6..d4ad9c7 100644
--- a/scripts/upgrade.py
+++ b/scripts/upgrade.py
@@ -5,6 +5,27 @@ import time
import pylxd
from pylxd import Client
+# FIXME versions
+package_replacements = {
+ '19.07': {
+ 'bird4': 'bird1-ipv4',
+ 'bird4-uci': 'bird1-ipv4-uci',
+ 'birdc4': 'bird1c-ipv4',
+ 'birdcl4': 'bird1cl-ipv4',
+ 'bird6': 'bird1-ipv6',
+ 'bird6-uci': 'bird1-ipv6-uci',
+ 'birdc6': 'bird1c-ipv6',
+ 'birdcl6': 'bird1cl-ipv6',
+ },
+}
+
+# FIXME input version
+def old_to_new_package(name):
+ if name in package_replacements:
+ return package_replacements[name]
+ else:
+ return name
+
class ExecuteError(RuntimeError):
def __init__(self, command, exit_code):
self.command = command
@@ -122,7 +143,7 @@ class Container:
if len(res) == 3:
(name, _, version) = res
old_packages.append(name)
- return frozenset(old_packages)
+ return frozenset([ old_to_new_package(i) for i in old_packages ])
def package_set(self):
return self._package_set_from_str(self.opkg_list_installed())
@@ -135,7 +156,7 @@ def usage(argv):
exit(1)
def main(argv):
- is_allow_existing = False
+ is_allow_existing = True
if len(argv) == 4:
pos = 1