| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
. ${top_srcdir-.}/tests/common.sh |
| 4 |
|
| 5 |
mkdir dir |
| 6 |
cat << EOF > dir/file.orig |
| 7 |
a |
| 8 |
b |
| 9 |
EOF |
| 10 |
cat << EOF > abc |
| 11 |
a |
| 12 |
b |
| 13 |
c |
| 14 |
EOF |
| 15 |
cat << EOF > abd |
| 16 |
a |
| 17 |
b |
| 18 |
d |
| 19 |
EOF |
| 20 |
cp abc dir/file |
| 21 |
# "gendiff dir .orig" without requiring gendiff: |
| 22 |
(printf "diff -up dir/file.orig dir/file\n" |
| 23 |
diff -up dir/file.orig dir/file) > patch1 |
| 24 |
|
| 25 |
cp abd dir/file |
| 26 |
mv dir/file.orig dir/file.old |
| 27 |
(printf "diff -up dir/file.old dir/file\n" |
| 28 |
diff -up dir/file.old dir/file) > patch2 |
| 29 |
|
| 30 |
${INTERDIFF} patch1 patch2 2>errors > patch1-2 || exit 1 |
| 31 |
[ -s errors ] && exit 1 |
| 32 |
mkdir test |
| 33 |
cp abc test/file |
| 34 |
cd test |
| 35 |
${PATCH} -p1 < ../patch1-2 || exit 1 |
| 36 |
cd .. |
| 37 |
cmp abd test/file || exit 1 |
| 38 |
cd test |
| 39 |
${PATCH} -R < ../patch1-2 || exit 1 |
| 40 |
cd .. |
| 41 |
cmp abc test/file || exit 1 |