diff options
-rw-r--r-- | scripts/upgrade.py | 25 |
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 |