Merge pull request #18149 from cho-m/perl-shebang-whitespaces

keg_relocate: allow spaces/tabs after shebang
This commit is contained in:
Bo Anderson 2024-08-24 20:16:43 +01:00 committed by GitHub
commit e521f3947b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,7 +96,7 @@ class Keg
end
relocation.add_replacement_pair(:library, HOMEBREW_LIBRARY.to_s, LIBRARY_PLACEHOLDER, path: true)
relocation.add_replacement_pair(:perl,
%r{\A#!(?:/usr/bin/perl\d\.\d+|#{HOMEBREW_PREFIX}/opt/perl/bin/perl)( |$)}o,
%r{\A#![ \t]*(?:/usr/bin/perl\d\.\d+|#{HOMEBREW_PREFIX}/opt/perl/bin/perl)( |$)}o,
"#!#{PERL_PLACEHOLDER}\\1")
relocation.add_replacement_pair(:java, JAVA_REGEX, JAVA_PLACEHOLDER)