File tree 1 file changed +9
-3
lines changed
pkgs/tools/typesetting/tex/texlive
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -155,18 +155,24 @@ in buildEnv {
155
155
--prefix PERL5LIB : "$out/share/texmf/scripts/texlive"
156
156
157
157
# avoid using non-nix shebang in $target by calling interpreter
158
- if [[ "$(head -c 2 $target)" = "#!" ]]; then
159
- local cmdline="$(head -n 1 $target | sed 's/^\#\! *//;s/ *$//')"
158
+ if [[ "$(head -c 2 " $target" )" = "#!" ]]; then
159
+ local cmdline="$(head -n 1 " $target" | sed 's/^\#\! *//;s/ *$//')"
160
160
local relative=`basename "$cmdline" | sed 's/^env //' `
161
161
local newInterp=`echo "$relative" | cut -d\ -f1`
162
162
local params=`echo "$relative" | cut -d\ -f2- -s`
163
- local newPath="$(type -P $newInterp)"
163
+ local newPath="$(type -P " $newInterp" )"
164
164
if [[ -z "$newPath" ]]; then
165
165
echo " Warning: unknown shebang '$cmdline' in '$target'"
166
166
continue
167
167
fi
168
168
echo " and patching shebang '$cmdline'"
169
169
sed "s|^exec |exec $newPath $params |" -i "$link"
170
+
171
+ elif head -n 1 "$target" | grep -q 'exec perl'; then
172
+ # see #24343 for details of the problem
173
+ echo " and patching weird perl shebang"
174
+ sed "s|^exec |exec '${ perl } /bin/perl' -w |" -i "$link"
175
+
170
176
else
171
177
sed 's|^exec |exec -a "$0" |' -i "$link"
172
178
echo
You can’t perform that action at this time.
0 commit comments