Fix self.extension for symlinks (#31743)
`self.archive_file` is (among others) a symlink to a tarball. `extension()` on a symlink will result in no extension. This patch fixes the behavior introduced in https://github.com/spack/spack/pull/31618. Co-authored-by: Stephen Sachs <stesachs@amazon.com>
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
import spack.config
|
import spack.config
|
||||||
import spack.error
|
import spack.error
|
||||||
|
import spack.url
|
||||||
import spack.util.crypto as crypto
|
import spack.util.crypto as crypto
|
||||||
import spack.util.pattern as pattern
|
import spack.util.pattern as pattern
|
||||||
import spack.util.url as url_util
|
import spack.util.url as url_util
|
||||||
@@ -529,8 +530,9 @@ def expand(self):
|
|||||||
"Couldn't find archive file",
|
"Couldn't find archive file",
|
||||||
"Failed on expand() for URL %s" % self.url)
|
"Failed on expand() for URL %s" % self.url)
|
||||||
|
|
||||||
|
# TODO: replace this by mime check.
|
||||||
if not self.extension:
|
if not self.extension:
|
||||||
self.extension = extension(self.archive_file)
|
self.extension = spack.url.determine_url_file_extension(self.url)
|
||||||
|
|
||||||
if self.stage.expanded:
|
if self.stage.expanded:
|
||||||
tty.debug('Source already staged to %s' % self.stage.source_path)
|
tty.debug('Source already staged to %s' % self.stage.source_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user