From 9231f1371a9211aea45f706b96d94aa7471ce164 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 4 Apr 2020 02:31:37 +0300 Subject: project.boost.download: --unpack = --cache if specified --- project/boost/download.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'project/boost') diff --git a/project/boost/download.py b/project/boost/download.py index 13a89f4..d1fc8ea 100644 --- a/project/boost/download.py +++ b/project/boost/download.py @@ -68,7 +68,13 @@ def _download_if_necessary(version, storage): class DownloadParameters: - def __init__(self, version, unpack_dir='.', cache_dir=None): + def __init__(self, version, unpack_dir=None, cache_dir=None): + if unpack_dir is None: + if cache_dir is None: + unpack_dir = '.' + else: + unpack_dir = cache_dir + self.version = version self.unpack_dir = normalize_path(unpack_dir) self.storage = TemporaryStorage(unpack_dir) @@ -98,7 +104,7 @@ def _parse_args(argv=None): formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--unpack', metavar='DIR', dest='unpack_dir', - type=normalize_path, default='.', + type=normalize_path, help='directory to unpack the archive to') parser.add_argument('--cache', metavar='DIR', dest='cache_dir', type=normalize_path, -- cgit v1.2.3