summaryrefslogtreecommitdiff
path: root/tsp/scripts
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-10-06 14:14:06 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-01-09 18:46:14 (GMT)
commit4934a8ae642ada596cedb304f48138636a5f33f1 (patch)
tree42cb6c05c0d1c7a6ad95efbb3448d4516d4c6123 /tsp/scripts
parent56def2b80c3a4630c9c1ca20145a25c280e84637 (diff)
downloadmajor-4934a8ae642ada596cedb304f48138636a5f33f1.zip
major-4934a8ae642ada596cedb304f48138636a5f33f1.tar.gz
major-4934a8ae642ada596cedb304f48138636a5f33f1.tar.bz2
Add "--dry-run" argument to download_image.pyrefs/changes/78/95278/5
Images will not be downloaded and project.conf file not created. Change-Id: Ibb5682b8167f273cc0adb1616afce87ca55efe60 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Diffstat (limited to 'tsp/scripts')
-rwxr-xr-xtsp/scripts/download_image.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tsp/scripts/download_image.py b/tsp/scripts/download_image.py
index 74ac03c..52a4510 100755
--- a/tsp/scripts/download_image.py
+++ b/tsp/scripts/download_image.py
@@ -98,9 +98,10 @@ class ImageVersion(object):
class ImageDownloader:
- def __init__(self, url, target):
+ def __init__(self, url, target, dry):
self.url = url
self.target = target
+ self.dry = dry
img_ver = ImageVersion(url)
self.snap_nr = img_ver.get_snapshot()
@@ -186,6 +187,9 @@ class ImageDownloader:
logging.debug("Package files (snapshot): %s", self.snap_pkgs)
def run(self):
+ if self.dry:
+ logging.debug("Skipping: run")
+ return
if not self.is_prerelease:
self.write_diff_for_snapshot()
elif self.check_diff(self.fetch_url(self.pkgs), self.fetch_url(self.snap_pkgs)):
@@ -194,6 +198,9 @@ class ImageDownloader:
self.get(self.imgs, self.md5sums)
def create_projectconf(self, arch, target_name):
+ if self.dry:
+ logging.debug("Skipping: create project.conf file for: %s %s", arch, target_name)
+ return
logging.debug("Create project.conf file for: %s %s", arch, target_name)
prjconf = [ "tizen-common_" + self.ver_nr, arch, target_name ]
with open("project-" + self.target + ".conf", 'w') as f:
@@ -272,6 +279,10 @@ def parse_arguments():
action="store", dest="target",
help="Choose target device (odroid, minnow32, minnow64) to download images for")
+ parser.add_argument("-d", "--dry-run",
+ action="store_true", dest="dry",
+ help="Dry run - do not actually download images")
+
parser.add_argument("-l", "--log",
action="store", dest="loglevel",
help="Verbosity level")
@@ -288,7 +299,7 @@ def main():
raise ValueError('Invalid log level: %s' % args.loglevel)
logging.basicConfig(format='%(asctime)s %(message)s',level=numeric_level)
logging.debug("Begin")
- downloader = ImageDownloader(args.url, args.target)
+ downloader = ImageDownloader(args.url, args.target, args.dry)
downloader.run()
logging.debug("End")