From b34368eb2d9372ec79026ae535be1cefe0d4a33d Mon Sep 17 00:00:00 2001
From: Davide Gardenal <davide.gardenal@huawei.com>
Date: Wed, 27 Jul 2022 07:37:24 +0200
Subject: [PATCH] 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 <davide.gardenal@huawei.com>
---
 scripts/upgrade_oniro/upgrade_oniro.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/upgrade_oniro/upgrade_oniro.py b/scripts/upgrade_oniro/upgrade_oniro.py
index 41cb1f69..960be5c5 100644
--- a/scripts/upgrade_oniro/upgrade_oniro.py
+++ b/scripts/upgrade_oniro/upgrade_oniro.py
@@ -54,6 +54,7 @@ machine = ""
 flavour = ""
 image = ""
 conf_directory = pathlib.Path()
+dry_run = False
 
 def init_script_options():
     parser = argparse.ArgumentParser(description=script_description)
@@ -75,16 +76,19 @@ def init_script_options():
                         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,
                         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())
-    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"]
     build_directory = parsed_args["build_directory"]
     machine = parsed_args["machine"]
     flavour = parsed_args["flavour"]
     image = parsed_args["image"]
     conf_directory = parsed_args["conf_directory"]
+    dry_run = parsed_args["dry_run"]
 
 def upgrade_tool():
     # TODO
-- 
GitLab