Skip to content

Commit dde4695

Browse files
authored
Minor cleanup (RsyncProject#214)
- use `grep -E` and `grep -F` (`egrep` and `fgrep` are non-standard) - use same hashbang style for all test scripts - use explicit comparisons in test scripts - remove redundant ; from test scripts - make test script not executable, just like all the other scripts - unify codestyle across all test scripts - make openssl license exception clearer by having it at the top - use modern links in COPYING. The text now matches: https://www.gnu.org/licenses/gpl-3.0.txt - fix typo
1 parent 3337930 commit dde4695

39 files changed

+102
-120
lines changed

COPYING

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
REGARDING OPENSSL AND XXHASH
2+
3+
In addition, as a special exception, the copyright holders give
4+
permission to dynamically link rsync with the OpenSSL and xxhash
5+
libraries when those libraries are being distributed in compliance
6+
with their license terms, and to distribute a dynamically linked
7+
combination of rsync and these libraries. This is also considered
8+
to be covered under the GPL's System Libraries exception.
9+
110
GNU GENERAL PUBLIC LICENSE
211
Version 3, 29 June 2007
312

4-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
13+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
514
Everyone is permitted to copy and distribute verbatim copies
615
of this license document, but changing it is not allowed.
716

@@ -645,7 +654,7 @@ the "copyright" line and a pointer to where the full notice is found.
645654
GNU General Public License for more details.
646655

647656
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <http://www.gnu.org/licenses/>.
657+
along with this program. If not, see <https://www.gnu.org/licenses/>.
649658

650659
Also add information on how to contact you by electronic and paper mail.
651660

@@ -664,20 +673,11 @@ might be different; for a GUI interface, you would use an "about box".
664673
You should also get your employer (if you work as a programmer) or school,
665674
if any, to sign a "copyright disclaimer" for the program, if necessary.
666675
For more information on this, and how to apply and follow the GNU GPL, see
667-
<http://www.gnu.org/licenses/>.
676+
<https://www.gnu.org/licenses/>.
668677

669678
The GNU General Public License does not permit incorporating your program
670679
into proprietary programs. If your program is a subroutine library, you
671680
may consider it more useful to permit linking proprietary applications with
672681
the library. If this is what you want to do, use the GNU Lesser General
673682
Public License instead of this License. But first, please read
674-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
675-
676-
REGARDING OPENSSL AND XXHASH
677-
678-
In addition, as a special exception, the copyright holders give
679-
permission to dynamically link rsync with the OpenSSL and xxhash
680-
libraries when those libraries are being distributed in compliance
681-
with their license terms, and to distribute a dynamically linked
682-
combination of rsync and these libraries. This is also considered
683-
to be covered under the GPL's System Libraries exception.
683+
<https://www.gnu.org/licenses/why-not-lgpl.html>.

rsync.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
== ((unsigned)(b2) & (unsigned)(mask)))
110110

111111
/* Update this if you make incompatible changes and ALSO update the
112-
* SUBPROTOCOL_VERSION if it is not a final (offical) release. */
112+
* SUBPROTOCOL_VERSION if it is not a final (official) release. */
113113
#define PROTOCOL_VERSION 31
114114

115115
/* This is used when working on a new protocol version or for any unofficial

runtests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ RSYNC="$rsync_bin $*"
167167
#RSYNC="valgrind $rsync_bin $*"
168168

169169
TLS_ARGS=''
170-
if egrep '^#define HAVE_LUTIMES 1' config.h >/dev/null; then
170+
if grep -E '^#define HAVE_LUTIMES 1' config.h >/dev/null; then
171171
TLS_ARGS="$TLS_ARGS -l"
172172
fi
173-
if egrep '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then
173+
if grep -E '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then
174174
TLS_ARGS="$TLS_ARGS -L"
175175
fi
176176

support/rsync-no-vanished

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they
55

66
set -o pipefail
77

8-
rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true)
8+
rsync "${@}" 2>&1 | (grep -E -v "$IGNOREOUT" || true)
99
ret=$?
1010

1111
if [[ $ret == $IGNOREEXIT ]]; then

testsuite/00-hello.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
test_fail() {
44
echo "$@" >&2

testsuite/README.testsuite

-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@ you could include the log messages when reporting a failure.
2626

2727
These tests also run automatically on the build farm, and you can see
2828
the results on http://build.samba.org/.
29-
30-

testsuite/acls.test

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# This program is distributable under the terms of the GNU GPL (see
44
# COPYING).
@@ -17,8 +17,8 @@ files='foo file1 file2'
1717

1818
case "$setfacl_nodef" in
1919
true)
20-
if ! chmod --help 2>&1 | fgrep +a >/dev/null; then
21-
test_skipped "I don't know how to use setfacl or chmod for ACLs"
20+
if ! chmod --help 2>&1 | grep -F +a >/dev/null; then
21+
test_skipped "I don't know how to use setfacl or chmod for ACLs"
2222
fi
2323
chmod +a "root allow read,write,execute" "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled"
2424
chmod +a "root allow read,execute" "$fromdir/file1"
@@ -27,7 +27,7 @@ true)
2727
chmod +a "root allow read,execute" "$fromdir/file2"
2828

2929
see_acls() {
30-
ls -le "${@}"
30+
ls -le "${@}"
3131
}
3232
;;
3333
*)
@@ -45,7 +45,7 @@ true)
4545
setfacl -m u:0:5 "$fromdir/file2"
4646

4747
see_acls() {
48-
getfacl "${@}"
48+
getfacl "${@}"
4949
}
5050
;;
5151
esac

testsuite/atimes.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Test rsync copying atimes
44

testsuite/backup.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004-2020 Wayne Davison
44

testsuite/batch-mode.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004 by Chris Shoemaker <c.shoemaker@cox.net>
44

testsuite/chgrp.test

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

@@ -16,8 +16,7 @@
1616
mygrps="`rsync_getgroups`" || test_fail "Can't get groups"
1717
mkdir "$fromdir"
1818

19-
for g in $mygrps
20-
do
19+
for g in $mygrps; do
2120
name="$fromdir/foo-$g"
2221
date > "$name"
2322
chgrp "$g" "$name" || test_fail "Can't chgrp"

testsuite/chmod-option.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

@@ -31,7 +31,7 @@ chmod 770 "$dir2"
3131
# Copy the files we've created over to another directory
3232
checkit "$RSYNC -avv '$fromdir/' '$checkdir/'" "$fromdir" "$checkdir"
3333

34-
# And then manually make the changes which should occur
34+
# And then manually make the changes which should occur
3535
umask 002
3636
chmod ug-s,a+rX "$checkdir"/*
3737
chmod +w "$checkdir" "$checkdir"/dir*

testsuite/chmod-temp-dir.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004-2020 Wayne Davison
44

testsuite/chmod.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004-2020 Wayne Davison
44

testsuite/chown.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

testsuite/compare-dest.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004-2020 Wayne Davison
44

testsuite/crtimes.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Test rsync copying create times
44

testsuite/default-acls.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# This program is distributable under the terms of the GNU GPL (see
44
# COPYING).
@@ -21,7 +21,7 @@ testit() {
2121
todir="$scratchdir/$1"
2222
mkdir "$todir"
2323
$setfacl_nodef "$todir"
24-
if [ "$2" ]; then
24+
if [ -n "$2" ]; then
2525
case "$setfacl_nodef" in
2626
*-k*) opts="-dm $2" ;;
2727
*) opts="-m `echo $2 | sed 's/\([ugom]:\)/d:\1/g'`"

testsuite/delay-updates.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Test rsync --delay-updates
44

testsuite/delete.test

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2005-2020 Wayne Davison
44

55
# This program is distributable under the terms of the GNU GPL (see
66
# COPYING).
77

8-
# Test rsync handling of various delete directives.
8+
# Test rsync handling of various delete directives.
99

1010
. "$suitedir/rsync.fns"
1111

@@ -23,12 +23,12 @@ echo extra >"$todir"/emptydir/subdir/remove4
2323
# Also, make sure that --dry-run --del doesn't output anything extraneous.
2424
$RSYNC -av "$fromdir/" "$chkdir/copy/" >"$tmpdir/copy.out" 2>&1
2525
cat "$tmpdir/copy.out"
26-
egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new"
26+
grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new"
2727
mv "$tmpdir/copy.new" "$tmpdir/copy.out"
2828

2929
$RSYNC -avn --del "$fromdir/" "$chkdir/copy2/" >"$tmpdir/copy2.out" 2>&1 || true
3030
cat "$tmpdir/copy2.out"
31-
egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new"
31+
grep -E -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new"
3232
mv "$tmpdir/copy2.new" "$tmpdir/copy2.out"
3333

3434
diff $diffopt "$tmpdir/copy.out" "$tmpdir/copy2.out"

testsuite/devices.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

testsuite/dir-sgid.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# This program is distributable under the terms of the GNU GPL (see
44
# COPYING).

testsuite/duplicates.test

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

55
# This program is distributable under the terms of the GNU GPL (see
66
# COPYING).
77

8-
# Test rsync handling of duplicate filenames.
8+
# Test rsync handling of duplicate filenames.
99

1010
# It's quite possible that the user might specify the same source file
1111
# more than once on the command line, perhaps through shell variables
@@ -33,12 +33,10 @@ checkit "$RSYNC -avv '$fromdir/' '$fromdir/' '$fromdir/' '$fromdir/' '$fromdir/'
3333
| tee "$outfile"
3434

3535
# Make sure each file was only copied once...
36-
if [ `grep -c '^name1$' "$outfile"` != 1 ]
37-
then
36+
if [ `grep -c '^name1$' "$outfile"` != 1 ]; then
3837
test_fail "name1 was not copied exactly once"
3938
fi
40-
if [ `grep -c '^name2 -> ' "$outfile"` != 1 ]
41-
then
39+
if [ `grep -c '^name2 -> ' "$outfile"` != 1 ]; then
4240
test_fail "name2 was not copied exactly once"
4341
fi
4442

testsuite/exclude.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2003-2020 Wayne Davison
44

testsuite/executability.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# This program is distributable under the terms of the GNU GPL (see
44
# COPYING).

testsuite/fuzzy.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2005-2020 Wayne Davison
44

testsuite/hardlinks.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
44

testsuite/itemize.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2005-2020 Wayne Davison
44

testsuite/merge.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# Copyright (C) 2004-2020 Wayne Davison
44

testsuite/missing.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/bin/sh
22

33
# This program is distributable under the terms of the GNU GPL (see
44
# COPYING).

testsuite/mkpath.test

100755100644
File mode changed.

0 commit comments

Comments
 (0)