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

upgrade_oniro: add --dry-run option


The --dry-run option is not yet implemented but with
this commit it has been added to the list of parsed options.

Signed-off-by: Davide Gardenal's avatarDavide Gardenal <davide.gardenal@huawei.com>
parent c5ac82e8
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
# 1.4. Optional: Conf directory path, this can be specified in order to use a specific config directory. # 1.4. Optional: Conf directory path, this can be specified in order to use a specific config directory.
# In case we have a clean build directory and this is not specified the default config will be used. # In case we have a clean build directory and this is not specified the default config will be used.
# 1.5. Optional: Flavour. In case the conf directory is not specified and the build directory is empty it becomes mandatory # 1.5. Optional: Flavour. In case the conf directory is not specified and the build directory is empty it becomes mandatory
# 1.6. Some other stuff to control the output of the tool (TBD) # 1.6. Optional Flag: --dry-run: this enables the upgrade tool to create a local copy of the project and perform the upgrade on it.
# 1.7. Some other stuff to control the output of the tool (TBD)
# #
# 2. Check for tool updates. If the newest version of Oniro has a new version of this script it should be upgraded before # 2. Check for tool updates. If the newest version of Oniro has a new version of this script it should be upgraded before
# Oniro's upgrade, then it should be run instead of the old one. # Oniro's upgrade, then it should be run instead of the old one.
...@@ -54,6 +55,7 @@ machine = "" ...@@ -54,6 +55,7 @@ machine = ""
flavour = "" flavour = ""
image = "" image = ""
conf_directory = pathlib.Path() conf_directory = pathlib.Path()
dry_run = False
def init_script_options(): def init_script_options():
parser = argparse.ArgumentParser(description=script_description) parser = argparse.ArgumentParser(description=script_description)
...@@ -75,16 +77,19 @@ def init_script_options(): ...@@ -75,16 +77,19 @@ def init_script_options():
help = "The image that will be built to check if the upgrade is successful (oniro-image-base by default)") help = "The image that will be built to check if the upgrade is successful (oniro-image-base by default)")
parser.add_argument("-c", "--conf-directory", type=pathlib.Path, parser.add_argument("-c", "--conf-directory", type=pathlib.Path,
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",
help="Perform the upgrade on a local copy of the project.")
parsed_args = vars(parser.parse_args()) parsed_args = vars(parser.parse_args())
global target_version, build_directory, machine, flavour, image, conf_directory global target_version, build_directory, machine, flavour, image, conf_directory, dry_run
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"]
flavour = parsed_args["flavour"] flavour = parsed_args["flavour"]
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"]
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