summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@informatik.uni-hamburg.de>2020-02-26 07:39:54 +0100
committerPeter Scheibel <scheibel1@llnl.gov>2020-02-27 10:52:52 -0800
commitb7cfd05ef72f26524a35c983067cedcc9f3750f3 (patch)
treedd56967b81f3dfc628ef9098523263009d7213ef /lib
parent7325c207941f1dbd9d7cd83f9659eb25951ac1f9 (diff)
downloadspack-b7cfd05ef72f26524a35c983067cedcc9f3750f3.tar.gz
spack-b7cfd05ef72f26524a35c983067cedcc9f3750f3.tar.bz2
spack-b7cfd05ef72f26524a35c983067cedcc9f3750f3.tar.xz
spack-b7cfd05ef72f26524a35c983067cedcc9f3750f3.zip
Generalize curl_options into fetch_options
This allows us to support higher-level concepts such as 'cookie' and 'timeout' without users having to specify curl options.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/fetch_strategy.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 38ed17d28e..40d8b00728 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -257,7 +257,7 @@ class URLFetchStrategy(FetchStrategy):
self.digest = kwargs[h]
self.expand_archive = kwargs.get('expand', True)
- self.extra_curl_options = kwargs.get('curl_options', [])
+ self.extra_options = kwargs.get('fetch_options', [])
self._curl = None
self.extension = kwargs.get('extension', None)
@@ -343,7 +343,12 @@ class URLFetchStrategy(FetchStrategy):
else:
curl_args.append('-sS') # just errors when not.
- curl_args += self.extra_curl_options
+ if self.extra_options:
+ cookie = self.extra_options.get('cookie')
+ if cookie:
+ curl_args.append('-j') # junk cookies
+ curl_args.append('-b') # specify cookie
+ curl_args.append(cookie)
# Run curl but grab the mime type from the http headers
curl = self.curl