File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"errors"
5
+ "fmt"
5
6
"os"
6
7
"path/filepath"
7
8
"strings"
@@ -31,7 +32,8 @@ func (cmd *syncCmd) RegisterFlags(fl *pflag.FlagSet) {
31
32
}
32
33
33
34
// See https://lxadm.com/Rsync_exit_codes#List_of_standard_rsync_exit_codes.
34
- var NoRsync = errors .New ("rsync: exit status 2" )
35
+ var IncompatRsync = errors .New ("rsync: exit status 2" )
36
+ var StreamErrRsync = errors .New ("rsync: exit status 12" )
35
37
36
38
func (cmd * syncCmd ) Run (fl * pflag.FlagSet ) {
37
39
var (
@@ -79,8 +81,10 @@ func (cmd *syncCmd) Run(fl *pflag.FlagSet) {
79
81
err = s .Run ()
80
82
}
81
83
82
- if err == NoRsync {
84
+ if fmt . Sprintf ( "%v" , err ) == fmt . Sprintf ( "%v" , IncompatRsync ) {
83
85
flog .Fatal ("no compatible rsync present on remote machine" )
86
+ } else if fmt .Sprintf ("%v" , err ) == fmt .Sprintf ("%v" , StreamErrRsync ) {
87
+ flog .Fatal ("error in rsync protocol datastream (no installed remote rsync?)" )
84
88
} else {
85
89
flog .Fatal ("sync: %v" , err )
86
90
}
You can’t perform that action at this time.
0 commit comments