@@ -116,7 +116,10 @@ stdenv.mkDerivation rec {
116116 done
117117 '';
118118 genericPatches = ''
119− find src/main/java/com/google/devtools -type f -print0 | while IFS="" read -r -d "" path; do
119+ # substituteInPlace is rather slow, so prefilter the files with grep
120+ grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
121+ # If you add more replacements here, you must change the grep above!
122+ # Only files containing /bin are taken into account.
120123 substituteInPlace "$path" \
121124 --replace /bin/bash ${customBash}/bin/bash \
122125 --replace /usr/bin/env ${coreutils}/bin/env \