keg_relocate: allow spaces/tabs after shebang

This commit is contained in:
Michael Cho 2024-08-23 22:56:15 -04:00
parent 019fc519da
commit 04381b26dd
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

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)