| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
. ${top_srcdir-.}/tests/common.sh |
| 4 |
|
| 5 |
cat << EOF > orig |
| 6 |
a |
| 7 |
b |
| 8 |
c |
| 9 |
EOF |
| 10 |
cat << EOF > new1 |
| 11 |
a |
| 12 |
b |
| 13 |
EOF |
| 14 |
cat << EOF > new2 |
| 15 |
c |
| 16 |
a |
| 17 |
b |
| 18 |
EOF |
| 19 |
mkdir orig.dir new1.dir new2.dir |
| 20 |
cat << EOF > orig.dir/file |
| 21 |
a |
| 22 |
EOF |
| 23 |
cat << EOF > new1.dir/file |
| 24 |
b |
| 25 |
EOF |
| 26 |
|
| 27 |
cp new1 start |
| 28 |
${DIFF} -u orig new1 > patch1 |
| 29 |
${DIFF} -u orig new2 > patch2 |
| 30 |
${INTERDIFF} patch1 patch2 2>errors > patch1-2 || exit 1 |
| 31 |
[ -s errors ] && exit 1 |
| 32 |
${PATCH} < patch1-2 || exit 1 |
| 33 |
cmp new1 new2 || exit 1 |
| 34 |
${PATCH} -R < patch1-2 |
| 35 |
cmp new1 start || exit 1 |
| 36 |
|
| 37 |
cp new1 new4 |
| 38 |
cp new2 new3 |
| 39 |
cp new3 start |
| 40 |
${DIFF} -u orig new3 > patch3 |
| 41 |
${DIFF} -u orig new4 > patch4 |
| 42 |
${INTERDIFF} patch3 patch4 2>errors > patch3-4 || exit 1 |
| 43 |
[ -s errors ] && exit 1 |
| 44 |
${PATCH} < patch3-4 || exit 1 |
| 45 |
cmp new3 new4 || exit 1 |
| 46 |
${PATCH} -R < patch3-4 |
| 47 |
cmp new3 start || exit 1 |
| 48 |
|
| 49 |
${DIFF} -urN orig.dir new1.dir > patch5 |
| 50 |
${DIFF} -urN orig.dir new2.dir > patch6 |
| 51 |
${INTERDIFF} patch5 patch6 2>errors > patch5-6 || exit 1 |
| 52 |
[ -s errors ] && exit 1 |
| 53 |
${INTERDIFF} patch6 patch5 2>errors > patch6-5 || exit 1 |
| 54 |
[ -s errors ] && exit 1 |
| 55 |
cd new1.dir |
| 56 |
${PATCH} -p1 < ../patch5-6 || exit 1 |
| 57 |
cd .. |
| 58 |
${DIFF} -urN new1.dir new2.dir || exit 1 |
| 59 |
cd new1.dir |
| 60 |
${PATCH} -Rp1 < ../patch5-6 || exit 1 |
| 61 |
cd ../new2.dir |
| 62 |
${PATCH} -p1 < ../patch6-5 || exit 1 |
| 63 |
cd .. |
| 64 |
${DIFF} -urN new1.dir new2.dir || exit 1 |
| 65 |
cd new2.dir |
| 66 |
${PATCH} -Rp1 < ../patch6-5 || exit 1 |
| 67 |
cd .. |