rpm-build/gendiff

28 lines
602 B
Plaintext
Raw Normal View History

2002-03-25 23:16:26 +03:00
#!/bin/sh
diff_options=-up
2002-03-26 00:30:54 +03:00
if [ -z "$1" -o -z "$2" ]; then
2003-09-27 21:51:39 +04:00
echo "usage: ${0##*/} <directory> <diff-extension>" >&2
2002-03-26 00:30:54 +03:00
exit 1
fi
2003-09-27 21:51:39 +04:00
if [ -n "$3" ]; then
: ${SOURCEDIR:=`rpm --eval %_sourcedir`}
>"$SOURCEDIR/$1-$3.patch"
fi
2002-03-26 00:30:54 +03:00
2003-09-27 21:51:39 +04:00
find "$1" -mindepth 1 \( -name "*$2" -o -name ".*$2" \) -print |
LC_COLLATE=C sort -u |
2007-01-24 17:41:51 +03:00
while read -r fin; do
2003-09-27 21:51:39 +04:00
fou=`echo "$fin" |sed -e "s/$2\$//"`
[ -r "$fin" ] || fin="/dev/null"
[ -r "$fou" ] || fou="/dev/null"
if [ -n "$3" ]; then
diff $diff_options -- "$fin" "$fou" |
2003-09-27 21:51:39 +04:00
tee -a "$SOURCEDIR/$1-$3.patch"
else
diff $diff_options -- "$fin" "$fou"
2003-09-27 21:51:39 +04:00
fi
done