[openssh-commits] [openssh] 01/01: upstream: Use variable for diff options

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Nov 1 11:11:33 AEDT 2022


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit a1febadf426536612c2734168d409147c392e7cf
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Sun Oct 30 18:42:07 2022 +0000

    upstream: Use variable for diff options
    
    instead of unconditionally specifying "-rN". This will make life easier
    in -portable where not all diff's understand -N.
    
    OpenBSD-Regress-ID: 8b8a407115546be1c6d72d350b1e4f1f960d3cd3
---
 regress/scp.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/regress/scp.sh b/regress/scp.sh
index 44e6485b..18ad3ca8 100644
--- a/regress/scp.sh
+++ b/regress/scp.sh
@@ -1,22 +1,21 @@
-#	$OpenBSD: scp.sh,v 1.14 2022/05/15 23:48:07 djm Exp $
+#	$OpenBSD: scp.sh,v 1.16 2022/10/30 18:42:07 dtucker Exp $
 #	Placed in the Public Domain.
 
 tid="scp"
 
 #set -x
 
-# Figure out if diff understands "-N"
-if diff -N ${SRC}/scp.sh ${SRC}/scp.sh 2>/dev/null; then
-	DIFFOPT="-rN"
-else
-	DIFFOPT="-r"
-fi
-
 COPY2=${OBJ}/copy2
 DIR=${COPY}.dd
 DIR2=${COPY}.dd2
 COPY3=${OBJ}/copy.glob[123]
 DIR3=${COPY}.dd.glob[456]
+DIFFOPT="-rN"
+
+# Figure out if diff does not understand "-N"
+if ! diff -N ${SRC}/scp.sh ${SRC}/scp.sh 2>/dev/null; then
+	DIFFOPT="-r"
+fi
 
 SRC=`dirname ${SCRIPT}`
 cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.scp
@@ -131,13 +130,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

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list