From e30f53f206a3bd10ac524f3abf10e08e9aa2369f Mon Sep 17 00:00:00 2001 From: Lydéric Debusschère Date: Fri, 20 Oct 2023 00:00:24 +0200 Subject: perl: change permissions in order to apply patch on version 5.38.0 (#40609) Co-authored-by: Harmen Stoppels --- var/spack/repos/builtin/packages/perl/package.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index 7a4e15c1f7..299ae19436 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -32,6 +32,8 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package url = "http://www.cpan.org/src/5.0/perl-5.34.0.tar.gz" tags = ["windows"] + maintainers("LydDeb") + executables = [r"^perl(-?\d+.*)?$"] # see https://www.cpan.org/src/README.html for @@ -258,13 +260,23 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package # aren't writeable so make pp.c user writeable # before patching. This should probably walk the # source and make everything writeable in the future. + # The patch "zlib-ng.patch" also fail. So, apply chmod + # to Makefile.PL and Zlib.xs too. def do_stage(self, mirror_only=False): # Do Spack's regular stage super().do_stage(mirror_only) - # Add write permissions on file to be patched - filename = join_path(self.stage.source_path, "pp.c") - perm = os.stat(filename).st_mode - os.chmod(filename, perm | 0o200) + # Add write permissions on files to be patched + files_to_chmod = [ + join_path(self.stage.source_path, "pp.c"), + join_path(self.stage.source_path, "cpan/Compress-Raw-Zlib/Makefile.PL"), + join_path(self.stage.source_path, "cpan/Compress-Raw-Zlib/Zlib.xs"), + ] + for filename in files_to_chmod: + try: + perm = os.stat(filename).st_mode + os.chmod(filename, perm | 0o200) + except IOError: + continue def nmake_arguments(self): args = [] -- cgit v1.2.3-70-g09d2