mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
23 lines
767 B
Plaintext
23 lines
767 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# This script makes pretty looking patches provided that the old files
|
||
|
# are kept around with the .v0 suffix.
|
||
|
|
||
|
: ${backup_suffix="v0"}
|
||
|
backup_files=`find . -path "*.$backup_suffix" -type f | sort | uniq`
|
||
|
for oldfile in $backup_files; do
|
||
|
newfile=`echo $oldfile | sed 's,^\./,,;s,\.'$backup_suffix'$,,'`
|
||
|
oldlabel="$oldprefix$newfile"
|
||
|
newlabel="$newprefix$newfile"
|
||
|
find "$oldfile" ! -size 0 | grep . >/dev/null || \
|
||
|
{ oldfile="/dev/null"; oldlabel="/dev/null"; }
|
||
|
find "$newfile" ! -size 0 | grep . >/dev/null || \
|
||
|
{ newfile="/dev/null"; newlabel="/dev/null"; }
|
||
|
case $newfile in
|
||
|
*.c) dflags="-u -p" ;;
|
||
|
*ChangeLog*) dflags="-u1" ;;
|
||
|
*) dflags="-u" ;;
|
||
|
esac
|
||
|
diff $dflags -L "$oldlabel" -L "$newlabel" "$oldfile" "$newfile"
|
||
|
done
|