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()
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)):
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:
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")
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")