Skip to content
Snippets Groups Projects
Verified Commit 4813f4b2 authored by Davide Gardenal's avatar Davide Gardenal
Browse files

upgrade_oniro: add --store-backup option


With the --store-backup option the backup is stored
even if the upgrade was successful.

Signed-off-by: Davide Gardenal's avatarDavide Gardenal <davide.gardenal@huawei.com>
parent a75cc242
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ flavour = "" ...@@ -56,6 +56,7 @@ flavour = ""
image = "" image = ""
conf_directory = pathlib.Path() conf_directory = pathlib.Path()
dry_run = False dry_run = False
store_backup = False
def init_script_options(): def init_script_options():
parser = argparse.ArgumentParser(description=script_description) parser = argparse.ArgumentParser(description=script_description)
...@@ -79,10 +80,12 @@ def init_script_options(): ...@@ -79,10 +80,12 @@ def init_script_options():
help="Path to the config directory you want to use. If omitted the default configs will be use.") help="Path to the config directory you want to use. If omitted the default configs will be use.")
parser.add_argument("--dry-run", action="store_true", parser.add_argument("--dry-run", action="store_true",
help="Perform the upgrade on a local copy of the project.") help="Perform the upgrade on a local copy of the project.")
parser.add_argument("--store-backup", action="store_true",
help="Store the backup even if the upgrade was successful.")
parsed_args = vars(parser.parse_args()) parsed_args = vars(parser.parse_args())
global target_version, build_directory, machine, flavour, image, conf_directory, dry_run global target_version, build_directory, machine, flavour, image, conf_directory, dry_run, store_backup
target_version = parsed_args["target_version"] target_version = parsed_args["target_version"]
build_directory = parsed_args["build_directory"] build_directory = parsed_args["build_directory"]
machine = parsed_args["machine"] machine = parsed_args["machine"]
...@@ -90,6 +93,7 @@ def init_script_options(): ...@@ -90,6 +93,7 @@ def init_script_options():
image = parsed_args["image"] image = parsed_args["image"]
conf_directory = parsed_args["conf_directory"] conf_directory = parsed_args["conf_directory"]
dry_run = parsed_args["dry_run"] dry_run = parsed_args["dry_run"]
store_backup = parsed_args["store_backup"]
def upgrade_tool(): def upgrade_tool():
# TODO # TODO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment