modify_libcachesave 580 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. cachesave_recurse()
  3. {
  4. target="$1"
  5. printf "Doing $target\n"
  6. newtarget="${target//eatmydata/cachesave}"
  7. if [[ $target = *eatmydata* ]]; then
  8. # replace all matches
  9. echo mv "$target" "$newtarget"
  10. mv "$target" "$newtarget"
  11. fi
  12. target="$newtarget"
  13. if [[ -d $target ]]; then
  14. for entry in "$target"/*; do
  15. cachesave_recurse "$entry"
  16. done
  17. fi
  18. }
  19. for f in $(grep -R eatmydata -l); do sed -i -e "s/eatmydata/cachesave/g" $f; done
  20. cachesave_recurse .
  21. printf "\n\nAll done, just copy the libcachesave-VERSION.c over existing libcachesave/libcachesave.c\n"