summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/fetch_strategy.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index b5ce8495e3..f885980ccd 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -292,7 +292,15 @@ class URLFetchStrategy(FetchStrategy):
@property
def candidate_urls(self):
- return [self.url] + (self.mirrors or [])
+ urls = []
+
+ for url in [self.url] + (self.mirrors or []):
+ if url.startswith('file://'):
+ path = urllib_parse.quote(url[len('file://'):])
+ url = 'file://' + path
+ urls.append(url)
+
+ return urls
@_needs_stage
def fetch(self):