ldiff 807 B

1234567891011121314151617181920212223
  1. #! /bin/sh
  2. # This script makes pretty looking patches provided that the old files
  3. # are kept around with the .v0 suffix.
  4. : ${backup_suffix=${1:-"\.v0"}}
  5. backup_files=`find . -path "*$backup_suffix" -type f | sort -u`
  6. for oldfile in $backup_files; do
  7. newfile=`echo $oldfile | sed 's,^\./,,;s/'$backup_suffix'$//'`
  8. oldlabel="$oldprefix$newfile"
  9. newlabel="$newprefix$newfile"
  10. find "$oldfile" ! -size 0 | grep . >/dev/null || \
  11. { oldfile="/dev/null"; oldlabel="/dev/null"; }
  12. find "$newfile" ! -size 0 | grep . >/dev/null || \
  13. { newfile="/dev/null"; newlabel="/dev/null"; }
  14. case $newfile in
  15. *.c) dflags="-u -p" ;;
  16. *.po) dflags='-U 1 -I^#[:,.~]';;
  17. *ChangeLog*) dflags="-U 1" ;;
  18. *) dflags="-u" ;;
  19. esac
  20. diff $dflags -L "$oldlabel" -L "$newlabel" "$oldfile" "$newfile"
  21. done