From 5f7f793d4e1a03a5c6acec00973785be3659e123 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 13 May 2015 12:20:34 +0200 Subject: [PATCH] hplip: coalesce `find -exec sed` invocations No need to scan the (biggish) source tree six times, forking a separate process for every file each time. This was slowing down testing. --- pkgs/misc/drivers/hplip/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index b40aab73a4d1..41ed3e710427 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -33,12 +33,14 @@ stdenv.mkDerivation { prePatch = '' # HPLIP hardcodes absolute paths everywhere. Nuke from orbit. - find . -type f -exec sed -i s,/etc/hp,$out/etc/hp, {} \; - find . -type f -exec sed -i s,/etc/sane.d,$out/etc/sane.d, {} \; - find . -type f -exec sed -i s,/usr/include/libusb-1.0,${libusb1}/include/libusb-1.0, {} \; - find . -type f -exec sed -i s,/usr/share/hal/fdi/preprobe/10osvendor,$out/share/hal/fdi/preprobe/10osvendor, {} \; - find . -type f -exec sed -i s,/usr/lib/systemd/system,$out/lib/systemd/system, {} \; - find . -type f -exec sed -i s,/var/lib/hp,$out/var/lib/hp, {} \; + find . -type f -exec sed -i \ + -e s,/etc/hp,$out/etc/hp, \ + -e s,/etc/sane.d,$out/etc/sane.d, \ + -e s,/usr/include/libusb-1.0,${libusb1}/include/libusb-1.0, \ + -e s,/usr/share/hal/fdi/preprobe/10osvendor,$out/share/hal/fdi/preprobe/10osvendor, \ + -e s,/usr/lib/systemd/system,$out/lib/systemd/system, \ + -e s,/var/lib/hp,$out/var/lib/hp, \ + {} + ''; preConfigure = ''