diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2022-10-30 18:42:08 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2022-10-30 18:42:08 +0000 |
commit | baeb63d48397b3d2458061fba11993425a2ecc30 (patch) | |
tree | d3601764ef0c232415bc057d003d9e1732afe3a3 | |
parent | 7fcf4a44c22344d228a55f6c66dbb6d37e637600 (diff) |
Use variable for diff options instead of unconditionally specifying "-rN".
This will make life easier in -portable where not all diff's understand -N.
-rw-r--r-- | regress/usr.bin/ssh/scp.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/regress/usr.bin/ssh/scp.sh b/regress/usr.bin/ssh/scp.sh index 6476b4acaa2..10088a58c08 100644 --- a/regress/usr.bin/ssh/scp.sh +++ b/regress/usr.bin/ssh/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.15 2022/10/24 21:52:50 djm Exp $ +# $OpenBSD: scp.sh,v 1.16 2022/10/30 18:42:07 dtucker Exp $ # Placed in the Public Domain. tid="scp" @@ -10,6 +10,7 @@ DIR=${COPY}.dd DIR2=${COPY}.dd2 COPY3=${OBJ}/copy.glob[123] DIR3=${COPY}.dd.glob[456] +DIFFOPT="-rN" SRC=`dirname ${SCRIPT}` cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.scp @@ -92,21 +93,21 @@ for mode in scp sftp ; do rm -rf ${DIR2} cp ${DATA} ${DIR}/copy $SCP $scpopts -r ${DIR} somehost:${DIR2} || fail "copy failed" - diff -rN ${DIR} ${DIR2} || fail "corrupted copy" + diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" verbose "$tag: recursive local dir to local dir" scpclean rm -rf ${DIR2} cp ${DATA} ${DIR}/copy $SCP $scpopts -r ${DIR} ${DIR2} || fail "copy failed" - diff -rN ${DIR} ${DIR2} || fail "corrupted copy" + diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" verbose "$tag: recursive remote dir to local dir" scpclean rm -rf ${DIR2} cp ${DATA} ${DIR}/copy $SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed" - diff -rN ${DIR} ${DIR2} || fail "corrupted copy" + diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" verbose "$tag: unmatched glob file local->remote" scpclean @@ -124,13 +125,13 @@ for mode in scp sftp ; do cp ${DATA} ${DIR}/copy cp ${DATA} ${DIR}/copy.glob[1234] $SCP $scpopts -r ${DIR} somehost:${DIR3} || fail "copy failed" - diff -rN ${DIR} ${DIR3} || fail "corrupted copy" + diff ${DIFFOPT} ${DIR} ${DIR3} || fail "corrupted copy" verbose "$tag: unmatched glob dir recursive remote->local" # NB. no clean rm -rf ${DIR2} $SCP $scpopts -r somehost:${DIR3} ${DIR2} || fail "copy failed" - diff -rN ${DIR} ${DIR2} || fail "corrupted copy" + diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" verbose "$tag: shell metacharacters" scpclean @@ -148,7 +149,7 @@ for mode in scp sftp ; do chmod 660 ${DIR2}/copy $SUDO chown root ${DIR2}/copy $SCP -p $scpopts somehost:${DIR}/\* ${DIR2} >/dev/null 2>&1 - $SUDO diff -rN ${DIR} ${DIR2} || fail "corrupted copy" + $SUDO diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" $SUDO rm ${DIR2}/copy fi |