Skip to content

Commit 5cad4fc

Browse files
committed
Filter vanished file warnings from both stdout and stderr
Versions of rsync before 3.0 wrote warnings to stdout. The behavior was changed to write to stderr in 3.0 but we support versions going back to 2.6.4.
1 parent 8071484 commit 5cad4fc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libexec/ghe-rsync

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
set -o pipefail
99

10-
# Filter vanished file warnings from stderr. The complex redirections are
11-
# necessary to filter stderr while also keeping stdout and stderr separated.
10+
# Filter vanished file warnings from both stdout (rsync versions < 3.x) and
11+
# stderr (rsync versions >= 3.x). The complex redirections are necessary to
12+
# filter stderr while also keeping stdout and stderr separated.
1213
IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
1314
(rsync "${@}" 3>&1 1>&2 2>&3 3>&- |
14-
(egrep -v "$IGNOREOUT" || true)) 3>&1 1>&2 2>&3 3>&-
15+
(egrep -v "$IGNOREOUT" || true)) 3>&1 1>&2 2>&3 3>&- |
16+
(egrep -v "$IGNOREOUT" || true)
1517
res=$?
1618

1719
# rsync exits with 24 when vanished files are detected.

0 commit comments

Comments
 (0)