diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-03-14 10:57:08 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-03-14 11:00:05 +0100 |
commit | 1df2a6431fa1b51b9779070ce2a0171208985bf1 (patch) | |
tree | 265721affd6a61a94ff0fb8d182f623a226e95a2 /pkgs/tools/X11/xdg-utils | |
parent | fa50a1f11767c0011d850bf64f5cb132326f329f (diff) |
xdg-utils: replace commands more precisely
Fix #13904, close #13908.
Previously many messages got clobbered. Now it should be better.
The solution is still relatively hacky, but I don't see how to improve
it without doing lots of work.
Diffstat (limited to 'pkgs/tools/X11/xdg-utils')
-rw-r--r-- | pkgs/tools/X11/xdg-utils/default.nix | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pkgs/tools/X11/xdg-utils/default.nix b/pkgs/tools/X11/xdg-utils/default.nix index 23b406c2d43f..6f1335593621 100644 --- a/pkgs/tools/X11/xdg-utils/default.nix +++ b/pkgs/tools/X11/xdg-utils/default.nix @@ -28,18 +28,17 @@ stdenv.mkDerivation rec { postInstall = stdenv.lib.optionalString mimiSupport '' cp ${mimisrc}/xdg-open $out/bin/xdg-open - substituteInPlace $out/bin/xdg-open --replace "awk " "${gawk}/bin/awk " - substituteInPlace $out/bin/xdg-open --replace "sort " "${coreutils}/bin/sort " - substituteInPlace $out/bin/xdg-open --replace "(file " "(${file}/bin/file " - '' + '' - for item in $out/bin/*; do - substituteInPlace $item --replace "cut " "${coreutils}/bin/cut " - substituteInPlace $item --replace "sed " "${gnused}/bin/sed " - substituteInPlace $item --replace "egrep " "${gnugrep}/bin/egrep " - sed -i $item -re "s#([^e])grep #\1${gnugrep}/bin/grep #g" # Don't replace 'egrep' - substituteInPlace $item --replace "which " "type -P " - substituteInPlace $item --replace "/usr/bin/file" "${file}/bin/file" + '' + + '' + for tool in "${coreutils}/bin/cut" "${gnused}/bin/sed" \ + "${gnugrep}"/bin/{e,}grep "${file}/bin/file" \ + ${stdenv.lib.optionalString mimiSupport + '' "${gawk}/bin/awk" "${coreutils}/bin/sort" ''} ; + do + sed "s# $(basename "$tool") # $tool #g" -i "$out"/bin/* done + + sed 's# which # type -P #g' -i "$out"/bin/* ''; meta = with stdenv.lib; { |