aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-03-01 16:30:14 -0800
committerMartin Braun <martin.braun@ettus.com>2018-03-01 16:59:55 -0800
commitd7d2523a24e80a323429308bdb73f117f8f8b6c8 (patch)
tree42770408a35d18876fe8fcb41decca05b1d987c5
parent804905c6cf31b5f8e55b21ace365a5b4b2fb23d4 (diff)
downloaduhd-d7d2523a24e80a323429308bdb73f117f8f8b6c8.tar.gz
uhd-d7d2523a24e80a323429308bdb73f117f8f8b6c8.tar.bz2
uhd-d7d2523a24e80a323429308bdb73f117f8f8b6c8.zip
utils: Reenable UHD_IMAGES_DIR env var for uhd_images_downloader
This was forgotten in the transition to the new downloader. The command line options --install-location will still override the env variable if it exists.
-rw-r--r--host/utils/uhd_images_downloader.py.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in
index 73a29bad5..607e933ec 100644
--- a/host/utils/uhd_images_downloader.py.in
+++ b/host/utils/uhd_images_downloader.py.in
@@ -57,7 +57,8 @@ def parse_args():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-t', '--types', type=str, default="",
help="RegEx to select image sets from the manifest file.")
- parser.add_argument('-i', '--install-location', type=str, default=_DEFAULT_INSTALL_PATH,
+ parser.add_argument('-i', '--install-location',
+ default=None,
help="Set custom install location for images")
parser.add_argument('-m', '--manifest-location', type=str, default="",
help="Set custom location for the manifest file")
@@ -272,7 +273,14 @@ def main():
global _LOG_LEVEL
log("TRACE", "Default log level: {}".format(_LOG_LEVEL))
_LOG_LEVEL = _LOG_LEVEL - args.verbose + args.quiet
- images_dir = args.install_location
+ images_dir = _DEFAULT_INSTALL_PATH
+ if args.install_location:
+ images_dir = args.install_location
+ elif os.environ.get("UHD_IMAGES_DIR") != None and os.environ.get("UHD_IMAGES_DIR") != "":
+ images_dir = os.environ.get("UHD_IMAGES_DIR")
+ log("DEBUG",
+ "UHD_IMAGES_DIR environment variable is set, using to set "
+ "install location.")
log("INFO", "Images destination: {}".format(os.path.abspath(images_dir)))
try:
# If we're given a path to a manifest file, use it
@@ -308,7 +316,7 @@ def main():
if os.path.isfile(args.inventory_location):
inventory_fn = args.inventory_location
else:
- inventory_fn = os.path.join(args.install_location, _INVENTORY_FILENAME)
+ inventory_fn = os.path.join(images_dir, _INVENTORY_FILENAME)
inventory = parse_inventory(inventory_fn=inventory_fn)
log("TRACE", "Inventory: {}\n{}".format(
os.path.abspath(inventory_fn),