summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Sachs <stephenmsachs@gmail.com>2022-07-28 11:24:19 +0200
committerGitHub <noreply@github.com>2022-07-28 09:24:19 +0000
commit584cc47fb31c3f312779185a7532c6e0c0ce48d0 (patch)
treef7dfe4a94d0ddad1743753c87ef62d6c6876563e /lib
parent2dd4795f56690ea5ced8527bdfd716f625735a11 (diff)
downloadspack-584cc47fb31c3f312779185a7532c6e0c0ce48d0.tar.gz
spack-584cc47fb31c3f312779185a7532c6e0c0ce48d0.tar.bz2
spack-584cc47fb31c3f312779185a7532c6e0c0ce48d0.tar.xz
spack-584cc47fb31c3f312779185a7532c6e0c0ce48d0.zip
Fix parsing of clean_url (#31783)
In #31618 the idea was to determine the file extension heuristically by dropping query params etc from a url and then consider it as a file path. That broke for URLs that only have query params like http://example.com/?patch=x as it would result in empty string as basename. This PR reverts to the old behavior of saving files as ?patch=x in that case. Co-authored-by: Stephen Sachs <stesachs@amazon.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/stage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index e995716f6e..a5d29f2917 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(url_path))
+ clean_url = os.path.basename(
+ sup.sanitize_file_path(self.default_fetcher.url))
fnames.append(clean_url)
if self.mirror_paths: