|
1 | 1 | { fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio
|
2 |
| -, gnugrep, gzip, openssh |
| 2 | +, gnugrep, gnused, gawk, coreutils # needed at runtime by git-filter-branch etc |
| 3 | +, gzip, openssh |
3 | 4 | , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
|
4 | 5 | , libxslt, tcl, tk, makeWrapper, libiconv
|
5 | 6 | , svnSupport, subversionClient, perlLibs, smtpPerlLibs, gitwebPerlLibs
|
@@ -104,11 +105,24 @@ stdenv.mkDerivation {
|
104 | 105 | --replace ' grep' ' ${gnugrep}/bin/grep' \
|
105 | 106 | --replace ' egrep' ' ${gnugrep}/bin/egrep'
|
106 | 107 |
|
107 |
| - # Fix references to the perl binary. Note that the tab character |
108 |
| - # in the patterns is important. |
109 |
| - sed -i -e 's| perl -ne| ${perl}/bin/perl -ne|g' \ |
110 |
| - -e 's| perl -e| ${perl}/bin/perl -e|g' \ |
111 |
| - $out/libexec/git-core/{git-am,git-submodule} |
| 108 | + # Fix references to the perl, sed, awk and various coreutil binaries used by |
| 109 | + # shell scripts that git calls (e.g. filter-branch) |
| 110 | + SCRIPT="$(cat <<'EOS' |
| 111 | + BEGIN{ |
| 112 | + @a=( |
| 113 | + '${perl}/bin/perl', '${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk', |
| 114 | + '${coreutils}/bin/cut', '${coreutils}/bin/basename', '${coreutils}/bin/dirname', |
| 115 | + '${coreutils}/bin/wc', '${coreutils}/bin/tr' |
| 116 | + ); |
| 117 | + } |
| 118 | + foreach $c (@a) { |
| 119 | + $n=(split("/", $c))[-1]; |
| 120 | + s|(?<=[^#][^/.-])\b''${n}(?=\s)|''${c}|g |
| 121 | + } |
| 122 | + EOS |
| 123 | + )" |
| 124 | + perl -0777 -i -pe "$SCRIPT" \ |
| 125 | + $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,stash,submodule,subtree,web--browse} |
112 | 126 |
|
113 | 127 | # Fix references to gettext.
|
114 | 128 | substituteInPlace $out/libexec/git-core/git-sh-i18n \
|
|
0 commit comments