summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorBenjamin S. Kirk <benjamin.s.kirk@gmail.com>2023-01-10 15:27:29 -0700
committerGitHub <noreply@github.com>2023-01-10 14:27:29 -0800
commita5a291820296d8125810b794d03d0d1dafbc579a (patch)
tree1728b2531f6a1e76ca4c5a65f4d8eb2a2ec0eb38 /var
parent8dc3a09104daaa1d484f67d98d26ece3f1d5ac21 (diff)
downloadspack-a5a291820296d8125810b794d03d0d1dafbc579a.tar.gz
spack-a5a291820296d8125810b794d03d0d1dafbc579a.tar.bz2
spack-a5a291820296d8125810b794d03d0d1dafbc579a.tar.xz
spack-a5a291820296d8125810b794d03d0d1dafbc579a.zip
autoconf: fix for long perl shebangs with autoconf@2.70+ (#34331)
autoconf 2.70 uses use warnings instead of -w so that PERL=/usr/bin/env perl can be passed, but we want to fix absolute paths anyhow through sbang upon install. So, we stick to patching the one perl script that's used during the build.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/autoconf/package.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py
index 615221527a..9379a7ced1 100644
--- a/var/spack/repos/builtin/packages/autoconf/package.py
+++ b/var/spack/repos/builtin/packages/autoconf/package.py
@@ -83,7 +83,11 @@ class Autoconf(AutotoolsPackage, GNUMirrorPackage):
# We save and restore the modification timestamp of the file to prevent
# regeneration of the respective man page:
with keep_modification_time(patched_file):
- filter_file("^#! @PERL@ -w", "#! /usr/bin/env perl", patched_file)
+ if "@2.70:" in self.spec:
+ shebang_string = "^#! @PERL@"
+ else:
+ shebang_string = "^#! @PERL@ -w"
+ filter_file(shebang_string, "#! /usr/bin/env perl", patched_file)
if self.version == Version("2.62"):
# skip help2man for patched autoheader.in and autoscan.in
touch("man/autoheader.1")
@@ -99,10 +103,15 @@ class Autoconf(AutotoolsPackage, GNUMirrorPackage):
# target will try to rebuild the binaries (filter_file updates the
# timestamps)
+ if "@2.70:" in self.spec:
+ shebang_string = "#! {0}"
+ else:
+ shebang_string = "#! {0} -w"
+
# Revert sbang, so Spack's sbang hook can fix it up
filter_file(
"^#! /usr/bin/env perl",
- "#! {0} -w".format(self.spec["perl"].command.path),
+ shebang_string.format(self.spec["perl"].command.path),
self.prefix.bin.autom4te,
backup=False,
)