aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-04-04 02:31:37 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-04-04 02:31:37 +0300
commit9231f1371a9211aea45f706b96d94aa7471ce164 (patch)
tree3853dd52e2290624bc1307963e425adff878146a
parentproject.boost: retry downloads (diff)
downloadcmake-common-9231f1371a9211aea45f706b96d94aa7471ce164.tar.gz
cmake-common-9231f1371a9211aea45f706b96d94aa7471ce164.zip
project.boost.download: --unpack = --cache if specified
-rw-r--r--project/boost/download.py10
1 files changed, 8 insertions, 2 deletions
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,