summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-07-25 10:31:13 +0200
committerGitHub <noreply@github.com>2022-07-25 10:31:13 +0200
commitb56871dd9c5ea8821833ed9148f00b186b4d0b19 (patch)
tree488837fa3576f985b9aad2a0a0df62f768b2d74e
parentfe0643a14ea46ece6bc1197cc99c39e217dea696 (diff)
downloadspack-b56871dd9c5ea8821833ed9148f00b186b4d0b19.tar.gz
spack-b56871dd9c5ea8821833ed9148f00b186b4d0b19.tar.bz2
spack-b56871dd9c5ea8821833ed9148f00b186b4d0b19.tar.xz
spack-b56871dd9c5ea8821833ed9148f00b186b4d0b19.zip
Fix stage with uri params (#31618)
* don't determine extension of a url * parse url to drop query params from filename
-rw-r--r--lib/spack/spack/fetch_strategy.py2
-rw-r--r--lib/spack/spack/stage.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 8f17e7768b..e52cceeaa0 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -530,7 +530,7 @@ class URLFetchStrategy(FetchStrategy):
"Failed on expand() for URL %s" % self.url)
if not self.extension:
- self.extension = extension(self.url)
+ self.extension = extension(self.archive_file)
if self.stage.expanded:
tty.debug('Source already staged to %s' % self.stage.source_path)
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index a5d29f2917..e995716f6e 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -366,9 +366,9 @@ class Stage(object):
fnames = []
expanded = True
if isinstance(self.default_fetcher, fs.URLFetchStrategy):
+ url_path = url_util.parse(self.default_fetcher.url).path
expanded = self.default_fetcher.expand_archive
- clean_url = os.path.basename(
- sup.sanitize_file_path(self.default_fetcher.url))
+ clean_url = os.path.basename(sup.sanitize_file_path(url_path))
fnames.append(clean_url)
if self.mirror_paths: