Merge modified --with-rsh patch: we now determine the default
authorMartin Pool <mbp@samba.org>
Wed, 6 Feb 2002 04:37:09 +0000 (04:37 +0000)
committerMartin Pool <mbp@samba.org>
Wed, 6 Feb 2002 04:37:09 +0000 (04:37 +0000)
remote-execution command as follows:

 1) if --with-rsh is specified, use that.

 2) otherwise if remsh is in the path, use that.

 3) otherwise use rsh

If remsh is present, we always modify the order of parameters to suit
it.  This is a bit strange.

configure.in
rsync.h

index 92e34be..9456521 100644 (file)
@@ -5,7 +5,7 @@ AC_CONFIG_SRCDIR([byteorder.h])
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.52)
 
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.52)
 
-RSYNC_VERSION=2.5.2
+RSYNC_VERSION=2.5.3pre
 AC_SUBST(RSYNC_VERSION)
 AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
 
 AC_SUBST(RSYNC_VERSION)
 AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
 
@@ -82,11 +82,26 @@ AC_ARG_WITH(rsync-path,
        [  --with-rsync-path=PATH  set default --rsync-path to PATH (default: \"rsync\")],
        [ RSYNC_PATH="$with_rsync_path" ],
        [ RSYNC_PATH="rsync" ])
        [  --with-rsync-path=PATH  set default --rsync-path to PATH (default: \"rsync\")],
        [ RSYNC_PATH="$with_rsync_path" ],
        [ RSYNC_PATH="rsync" ])
-AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [ ])
+
+AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
+
+AC_ARG_WITH(rsh,
+       AC_HELP_STRING([--with-rsh=CMD], [set rsh command to CMD (default: \"remsh\" or \"rsh\")]))
 
 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
 
 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
-AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [ ])
+AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [remote shell is remsh not rsh])
+
+if test x"$with_rsh" != x
+then
+       RSYNC_RSH="$with_rsh"
+elif test x"$HAVE_REMSH" = x1
+then 
+       RSYNC_RSH="remsh"
+else
+       RSYNC_RSH="rsh"
+fi
 
 
+AC_DEFINE_UNQUOTED(RSYNC_RSH, "$RSYNC_RSH", [default -e command])
 
 # arrgh. libc in the current debian stable screws up the largefile
 # stuff, getting byte range locking wrong
 
 # arrgh. libc in the current debian stable screws up the largefile
 # stuff, getting byte range locking wrong
diff --git a/rsync.h b/rsync.h
index a8325d0..bb45907 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -85,11 +85,9 @@ enum logcode {FNONE=0, FERROR=1, FINFO=2, FLOG=3 };
 
 #include "config.h"
 
 
 #include "config.h"
 
-#if HAVE_REMSH
-#define RSYNC_RSH "remsh"
-#else
-#define RSYNC_RSH "rsh"
-#endif
+/* The default RSYNC_RSH is always set in config.h, either to "remsh",
+ * "rsh", or otherwise something specified by the user.  HAVE_REMSH
+ * controls parameter munging for HP/UX, etc. */
 
 #include <sys/types.h>
 
 
 #include <sys/types.h>