diff options
39 files changed, 102 insertions, 120 deletions
@@ -1,7 +1,16 @@ +REGARDING OPENSSL AND XXHASH + +In addition, as a special exception, the copyright holders give +permission to dynamically link rsync with the OpenSSL and xxhash +libraries when those libraries are being distributed in compliance +with their license terms, and to distribute a dynamically linked +combination of rsync and these libraries. This is also considered +to be covered under the GPL's System Libraries exception. + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +654,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. @@ -664,20 +673,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. +<https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. - -REGARDING OPENSSL AND XXHASH - -In addition, as a special exception, the copyright holders give -permission to dynamically link rsync with the OpenSSL and xxhash -libraries when those libraries are being distributed in compliance -with their license terms, and to distribute a dynamically linked -combination of rsync and these libraries. This is also considered -to be covered under the GPL's System Libraries exception. +<https://www.gnu.org/licenses/why-not-lgpl.html>. @@ -109,7 +109,7 @@ == ((unsigned)(b2) & (unsigned)(mask))) /* Update this if you make incompatible changes and ALSO update the - * SUBPROTOCOL_VERSION if it is not a final (offical) release. */ + * SUBPROTOCOL_VERSION if it is not a final (official) release. */ #define PROTOCOL_VERSION 31 /* This is used when working on a new protocol version or for any unofficial diff --git a/runtests.sh b/runtests.sh index ecb383e8..eb108706 100755 --- a/runtests.sh +++ b/runtests.sh @@ -167,10 +167,10 @@ RSYNC="$rsync_bin $*" #RSYNC="valgrind $rsync_bin $*" TLS_ARGS='' -if egrep '^#define HAVE_LUTIMES 1' config.h >/dev/null; then +if grep -E '^#define HAVE_LUTIMES 1' config.h >/dev/null; then TLS_ARGS="$TLS_ARGS -l" fi -if egrep '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then +if grep -E '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then TLS_ARGS="$TLS_ARGS -L" fi diff --git a/support/rsync-no-vanished b/support/rsync-no-vanished index cc3c29ce..0f0bb22f 100755 --- a/support/rsync-no-vanished +++ b/support/rsync-no-vanished @@ -5,7 +5,7 @@ IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they set -o pipefail -rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true) +rsync "${@}" 2>&1 | (grep -E -v "$IGNOREOUT" || true) ret=$? if [[ $ret == $IGNOREEXIT ]]; then diff --git a/testsuite/00-hello.test b/testsuite/00-hello.test index ecb26348..ed72c0bd 100644 --- a/testsuite/00-hello.test +++ b/testsuite/00-hello.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh test_fail() { echo "$@" >&2 diff --git a/testsuite/README.testsuite b/testsuite/README.testsuite index d2fbe90c..782cb1ca 100644 --- a/testsuite/README.testsuite +++ b/testsuite/README.testsuite @@ -26,5 +26,3 @@ you could include the log messages when reporting a failure. These tests also run automatically on the build farm, and you can see the results on http://build.samba.org/. - - diff --git a/testsuite/acls.test b/testsuite/acls.test index 5728cd57..23449018 100644 --- a/testsuite/acls.test +++ b/testsuite/acls.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). @@ -17,8 +17,8 @@ files='foo file1 file2' case "$setfacl_nodef" in true) - if ! chmod --help 2>&1 | fgrep +a >/dev/null; then - test_skipped "I don't know how to use setfacl or chmod for ACLs" + if ! chmod --help 2>&1 | grep -F +a >/dev/null; then + test_skipped "I don't know how to use setfacl or chmod for ACLs" fi chmod +a "root allow read,write,execute" "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled" chmod +a "root allow read,execute" "$fromdir/file1" @@ -27,7 +27,7 @@ true) chmod +a "root allow read,execute" "$fromdir/file2" see_acls() { - ls -le "${@}" + ls -le "${@}" } ;; *) @@ -45,7 +45,7 @@ true) setfacl -m u:0:5 "$fromdir/file2" see_acls() { - getfacl "${@}" + getfacl "${@}" } ;; esac diff --git a/testsuite/atimes.test b/testsuite/atimes.test index 6dd58136..3bdb1d46 100644 --- a/testsuite/atimes.test +++ b/testsuite/atimes.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Test rsync copying atimes diff --git a/testsuite/backup.test b/testsuite/backup.test index 3b49db94..925c9fe0 100644 --- a/testsuite/backup.test +++ b/testsuite/backup.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004-2020 Wayne Davison diff --git a/testsuite/batch-mode.test b/testsuite/batch-mode.test index 7f92e482..cf4e94d3 100644 --- a/testsuite/batch-mode.test +++ b/testsuite/batch-mode.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004 by Chris Shoemaker <c.shoemaker@cox.net> diff --git a/testsuite/chgrp.test b/testsuite/chgrp.test index 8cd6c107..467d4029 100644 --- a/testsuite/chgrp.test +++ b/testsuite/chgrp.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> @@ -16,8 +16,7 @@ mygrps="`rsync_getgroups`" || test_fail "Can't get groups" mkdir "$fromdir" -for g in $mygrps -do +for g in $mygrps; do name="$fromdir/foo-$g" date > "$name" chgrp "$g" "$name" || test_fail "Can't chgrp" diff --git a/testsuite/chmod-option.test b/testsuite/chmod-option.test index 81fd38c7..ddf764cf 100644 --- a/testsuite/chmod-option.test +++ b/testsuite/chmod-option.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> @@ -31,7 +31,7 @@ chmod 770 "$dir2" # Copy the files we've created over to another directory checkit "$RSYNC -avv '$fromdir/' '$checkdir/'" "$fromdir" "$checkdir" -# And then manually make the changes which should occur +# And then manually make the changes which should occur umask 002 chmod ug-s,a+rX "$checkdir"/* chmod +w "$checkdir" "$checkdir"/dir* diff --git a/testsuite/chmod-temp-dir.test b/testsuite/chmod-temp-dir.test index d31a1bdf..e5541e4c 100644 --- a/testsuite/chmod-temp-dir.test +++ b/testsuite/chmod-temp-dir.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004-2020 Wayne Davison diff --git a/testsuite/chmod.test b/testsuite/chmod.test index f2dd4399..63258df7 100644 --- a/testsuite/chmod.test +++ b/testsuite/chmod.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004-2020 Wayne Davison diff --git a/testsuite/chown.test b/testsuite/chown.test index 3aec55a9..5dadb836 100644 --- a/testsuite/chown.test +++ b/testsuite/chown.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> diff --git a/testsuite/compare-dest.test b/testsuite/compare-dest.test index 7f193c58..3c634857 100644 --- a/testsuite/compare-dest.test +++ b/testsuite/compare-dest.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004-2020 Wayne Davison diff --git a/testsuite/crtimes.test b/testsuite/crtimes.test index aa71b456..51bfe301 100644 --- a/testsuite/crtimes.test +++ b/testsuite/crtimes.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Test rsync copying create times diff --git a/testsuite/default-acls.test b/testsuite/default-acls.test index 17893f93..a0a482ce 100644 --- a/testsuite/default-acls.test +++ b/testsuite/default-acls.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). @@ -21,7 +21,7 @@ testit() { todir="$scratchdir/$1" mkdir "$todir" $setfacl_nodef "$todir" - if [ "$2" ]; then + if [ -n "$2" ]; then case "$setfacl_nodef" in *-k*) opts="-dm $2" ;; *) opts="-m `echo $2 | sed 's/\([ugom]:\)/d:\1/g'`" diff --git a/testsuite/delay-updates.test b/testsuite/delay-updates.test index 5896a9c7..3b6226b4 100644 --- a/testsuite/delay-updates.test +++ b/testsuite/delay-updates.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Test rsync --delay-updates diff --git a/testsuite/delete.test b/testsuite/delete.test index 8c19827b..f54214cd 100644 --- a/testsuite/delete.test +++ b/testsuite/delete.test @@ -1,11 +1,11 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2005-2020 Wayne Davison # This program is distributable under the terms of the GNU GPL (see # COPYING). -# Test rsync handling of various delete directives. +# Test rsync handling of various delete directives. . "$suitedir/rsync.fns" @@ -23,12 +23,12 @@ echo extra >"$todir"/emptydir/subdir/remove4 # Also, make sure that --dry-run --del doesn't output anything extraneous. $RSYNC -av "$fromdir/" "$chkdir/copy/" >"$tmpdir/copy.out" 2>&1 cat "$tmpdir/copy.out" -egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new" +grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new" mv "$tmpdir/copy.new" "$tmpdir/copy.out" $RSYNC -avn --del "$fromdir/" "$chkdir/copy2/" >"$tmpdir/copy2.out" 2>&1 || true cat "$tmpdir/copy2.out" -egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new" +grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new" mv "$tmpdir/copy2.new" "$tmpdir/copy2.out" diff $diffopt "$tmpdir/copy.out" "$tmpdir/copy2.out" diff --git a/testsuite/devices.test b/testsuite/devices.test index 63d737c9..cd9cf3a2 100644 --- a/testsuite/devices.test +++ b/testsuite/devices.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> diff --git a/testsuite/dir-sgid.test b/testsuite/dir-sgid.test index dadc5507..d6b9a3c5 100644 --- a/testsuite/dir-sgid.test +++ b/testsuite/dir-sgid.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). diff --git a/testsuite/duplicates.test b/testsuite/duplicates.test index cd2f713a..3317e72f 100644 --- a/testsuite/duplicates.test +++ b/testsuite/duplicates.test @@ -1,11 +1,11 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> # This program is distributable under the terms of the GNU GPL (see # COPYING). -# Test rsync handling of duplicate filenames. +# Test rsync handling of duplicate filenames. # It's quite possible that the user might specify the same source file # more than once on the command line, perhaps through shell variables @@ -33,12 +33,10 @@ checkit "$RSYNC -avv '$fromdir/' '$fromdir/' '$fromdir/' '$fromdir/' '$fromdir/' | tee "$outfile" # Make sure each file was only copied once... -if [ `grep -c '^name1$' "$outfile"` != 1 ] -then +if [ `grep -c '^name1$' "$outfile"` != 1 ]; then test_fail "name1 was not copied exactly once" fi -if [ `grep -c '^name2 -> ' "$outfile"` != 1 ] -then +if [ `grep -c '^name2 -> ' "$outfile"` != 1 ]; then test_fail "name2 was not copied exactly once" fi diff --git a/testsuite/exclude.test b/testsuite/exclude.test index 9bc3b542..bd21c51c 100644 --- a/testsuite/exclude.test +++ b/testsuite/exclude.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2003-2020 Wayne Davison diff --git a/testsuite/executability.test b/testsuite/executability.test index 05a64e48..8f09d8f8 100644 --- a/testsuite/executability.test +++ b/testsuite/executability.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). diff --git a/testsuite/fuzzy.test b/testsuite/fuzzy.test index 05c5b068..2415173d 100644 --- a/testsuite/fuzzy.test +++ b/testsuite/fuzzy.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2005-2020 Wayne Davison diff --git a/testsuite/hardlinks.test b/testsuite/hardlinks.test index 6c4fafbc..af2ea408 100644 --- a/testsuite/hardlinks.test +++ b/testsuite/hardlinks.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> diff --git a/testsuite/itemize.test b/testsuite/itemize.test index 6a85ffab..92327238 100644 --- a/testsuite/itemize.test +++ b/testsuite/itemize.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2005-2020 Wayne Davison diff --git a/testsuite/merge.test b/testsuite/merge.test index 9b20f73d..5f9a6da6 100644 --- a/testsuite/merge.test +++ b/testsuite/merge.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2004-2020 Wayne Davison diff --git a/testsuite/missing.test b/testsuite/missing.test index c6c8e576..2fbf4616 100644 --- a/testsuite/missing.test +++ b/testsuite/missing.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). diff --git a/testsuite/mkpath.test b/testsuite/mkpath.test index 80463454..80463454 100755..100644 --- a/testsuite/mkpath.test +++ b/testsuite/mkpath.test diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index 5c2ee016..1e2b399f 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -45,13 +45,12 @@ export HOME runtest() { echo $ECHO_N "Test $1: $ECHO_C" - if eval "$2" - then - echo "$ECHO_T done." - return 0 + if eval "$2"; then + echo "$ECHO_T done." + return 0 else - echo "$ECHO_T failed!" - return 1 + echo "$ECHO_T failed!" + return 1 fi } @@ -220,16 +219,13 @@ makepath() { (echo " makepath $p" # Absolute Unix path. - if echo $p | grep '^/' >/dev/null - then + if echo $p | grep '^/' >/dev/null; then cd / fi # This will break if $p contains a space. - for c in `echo $p | tr '/' ' '` - do - if [ -d "$c" ] || mkdir "$c" - then + for c in `echo $p | tr '/' ' '`; do + if [ -d "$c" ] || mkdir "$c"; then cd "$c" || return $? else echo "failed to create $c" >&2; return $? @@ -293,7 +289,7 @@ checkit() { fi echo "-------------" - if [ -z "$failed" ] ; then + if [ -z "$failed" ]; then return 0 fi @@ -338,14 +334,14 @@ checkdiff2() { failed="$failed status=$status" fi - if [ "$2" ]; then + if [ -n "$2" ]; then eval "cat '$outfile' | $2 >'$outfile.new'" mv "$outfile.new" "$outfile" fi diff $diffopt "$chkfile" "$outfile" || failed="$failed output differs" - if [ "$failed" ] ; then + if [ -n "$failed" ]; then echo "Failed:$failed" return 1 fi @@ -465,25 +461,21 @@ test_xfail() { # Determine what shell command will appropriately test for links. ln -s foo "$scratchdir/testlink" -for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test -do - for switch in -h -L - do - if $cmd $switch "$scratchdir/testlink" 2>/dev/null - then - # how nice - TEST_SYMLINK_CMD="$cmd $switch" - # i wonder if break 2 is portable? - break 2 - fi - done +for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test; do + for switch in -h -L; do + if $cmd $switch "$scratchdir/testlink" 2>/dev/null; then + # how nice + TEST_SYMLINK_CMD="$cmd $switch" + # i wonder if break 2 is portable? + break 2 + fi + done done # ok, now get rid of it rm "$scratchdir/testlink" -if [ "x$TEST_SYMLINK_CMD" = 'x' ] -then +if [ "x$TEST_SYMLINK_CMD" = 'x' ]; then test_fail "Couldn't determine how to test for symlinks" else echo "Testing for symlinks using '$TEST_SYMLINK_CMD'" diff --git a/testsuite/ssh-basic.test b/testsuite/ssh-basic.test index 4bcbdfe9..1559ca23 100644 --- a/testsuite/ssh-basic.test +++ b/testsuite/ssh-basic.test @@ -13,7 +13,7 @@ SSH="$scratchdir/src/support/lsh.sh" if test x"$rsync_enable_ssh_tests" = xyes; then - if type ssh >/dev/null ; then + if type ssh >/dev/null; then SSH=ssh fi fi diff --git a/testsuite/symlink-ignore.test b/testsuite/symlink-ignore.test index eec7a301..7055a920 100644 --- a/testsuite/symlink-ignore.test +++ b/testsuite/symlink-ignore.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2001 by Martin Pool <mbp@samba.org> @@ -18,18 +18,15 @@ $RSYNC -r "$fromdir/" "$todir" || test_fail "$RSYNC returned $?" [ -f "$todir/referent" ] || test_fail "referent was not copied" [ -d "$todir/from" ] && test_fail "extra level of directories" -if is_a_link "$todir/dangling" -then +if is_a_link "$todir/dangling"; then test_fail "dangling symlink was copied" fi -if is_a_link "$todir/relative" -then - test_fail "relative symlink was copied" +if is_a_link "$todir/relative"; then + test_fail "relative symlink was copied" fi -if is_a_link "$todir/absolute" -then +if is_a_link "$todir/absolute"; then test_fail "absolute symlink was copied" fi diff --git a/testsuite/trimslash.test b/testsuite/trimslash.test index ec551e65..2efaa078 100644 --- a/testsuite/trimslash.test +++ b/testsuite/trimslash.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool <mbp@samba.org> diff --git a/testsuite/unsafe-byname.test b/testsuite/unsafe-byname.test index 55df0865..75e72014 100644 --- a/testsuite/unsafe-byname.test +++ b/testsuite/unsafe-byname.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2002 by Martin Pool @@ -13,9 +13,8 @@ test_unsafe() { # or "unsafe" otherwise result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2" - if [ "$result" != "$3" ] - then - test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\"" + if [ "$result" != "$3" ]; then + test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\"" fi } diff --git a/testsuite/unsafe-links.test b/testsuite/unsafe-links.test index 479d606c..2d209eb6 100644 --- a/testsuite/unsafe-links.test +++ b/testsuite/unsafe-links.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Originally by VladimĂr Michl <Vladimir.Michl@hlubocky.del.cz> @@ -6,13 +6,13 @@ test_symlink() { is_a_link "$1" || test_fail "File $1 is not a symlink" -}; +} test_regular() { if [ ! -f "$1" ]; then - test_fail "File $1 is not regular file or not exists"; - fi; -}; + test_fail "File $1 is not regular file or not exists" + fi +} cd "$tmpdir" @@ -32,7 +32,7 @@ ln -s ../files/file1 "from/safe/links/" ln -s ../files/file2 "from/safe/links/" ln -s ../../unsafe/unsafefile "from/safe/links/" -echo "rsync with relative path and just -a"; +echo "rsync with relative path and just -a" $RSYNC -avv from/safe/ to test_symlink to/links/file1 test_symlink to/links/file2 @@ -44,23 +44,22 @@ test_regular to/links/file1 test_regular to/links/file2 test_regular to/links/unsafefile -echo "rsync with relative path and --copy-unsafe-links"; +echo "rsync with relative path and --copy-unsafe-links" $RSYNC -avv --copy-unsafe-links from/safe/ to test_symlink to/links/file1 test_symlink to/links/file2 test_regular to/links/unsafefile rm -rf to -echo "rsync with relative2 path"; +echo "rsync with relative2 path" (cd from; $RSYNC -avv --copy-unsafe-links safe/ ../to) test_symlink to/links/file1 test_symlink to/links/file2 test_regular to/links/unsafefile rm -rf to -echo "rsync with absolute path"; +echo "rsync with absolute path" $RSYNC -avv --copy-unsafe-links `pwd`/from/safe/ to test_symlink to/links/file1 test_symlink to/links/file2 test_regular to/links/unsafefile - diff --git a/testsuite/wildmatch.test b/testsuite/wildmatch.test index 12b872c8..fa225d90 100644 --- a/testsuite/wildmatch.test +++ b/testsuite/wildmatch.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Copyright (C) 2003-2020 Wayne Davison diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test index 59fe1601..455abef1 100644 --- a/testsuite/xattrs.test +++ b/testsuite/xattrs.test @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # This program is distributable under the terms of the GNU GPL (see # COPYING). @@ -150,7 +150,7 @@ xls $dirs $files | diff $diffopt "$scratchdir/xattrs.txt" - cd "$fromdir" -if [ "$dashH" ]; then +if [ -n "$dashH" ]; then for fn in $files; do name=`basename $fn` ln $fn ../lnk/$name @@ -162,7 +162,7 @@ checkit "$RSYNC -aiX $XFILT $dashH --super $altDest=../chk . ../to" "$fromdir" " cd "$todir" xls $dirs $files | diff $diffopt "$scratchdir/xattrs.txt" - -[ "$dashH" ] && rm -rf "$lnkdir" +[ -n "$dashH" ] && rm -rf "$lnkdir" cd "$fromdir" rm -rf "$todir" @@ -177,7 +177,7 @@ cd "$todir" xls $dirs $files | diff $diffopt "$scratchdir/xattrs.txt" - sed -n -e '/^[^d ][^ ]* *[^ ][^ ]* *[^ ][^ ]* *1 /p' "$scratchdir/ls-to" >"$scratchdir/ls-diff-all" -fgrep -v './file1' "$scratchdir/ls-diff-all" >"$scratchdir/ls-diff" || : +grep -F -v './file1' "$scratchdir/ls-diff-all" >"$scratchdir/ls-diff" || : if [ -s "$scratchdir/ls-diff" ]; then echo "Missing hard links on:" cat "$scratchdir/ls-diff" @@ -213,13 +213,13 @@ $RSYNC -aX file1 file2 $RSYNC -aX file1 file2 ../chk/ $RSYNC -aX --del ../chk/ . $RSYNC -aX file1 ../lnk/ -[ "$dashH" ] && ln "$chkdir/file1" ../lnk/extra-link +[ -n "$dashH" ] && ln "$chkdir/file1" ../lnk/extra-link xls file1 file2 >"$scratchdir/xattrs.txt" checkit "$RSYNC -aiiX $XFILT $dashH $altDest=../lnk . ../to" "$chkdir" "$todir" -[ "$dashH" ] && rm ../lnk/extra-link +[ -n "$dashH" ] && rm ../lnk/extra-link cd "$todir" xls file1 file2 | diff $diffopt "$scratchdir/xattrs.txt" - |