Quoting kevin@tigris.org:
> Author: kevin
> Date: 2002-05-17 04:52 GMT
> New Revision: 1973
>
> Modified:
> trunk/configure.in
> trunk/subversion/libsvn_subr/io.c
> Log:
> Support newer versions of diffutils when they are installed in
> non-standard
> locations. Tested with diffutils 2.7 and diffutils 2.8.
>
> * configure.in - Determine whether or not diff3 supports the
> --diff-program
> arg and define SVN_DIFF3_HAS_DIFF_PROGRAM_ARG if it does.
>
> * subversion/libsvn_subr/io.c (svn_io_run_diff3) - Pass --diff-program
> to diff3
> if it supports it.
>
>
> Modified: trunk/configure.in
> ==============================================================================
> --- trunk/configure.in (original)
> +++ trunk/configure.in Thu May 16 23:52:34 2002
> @@ -262,6 +262,19 @@
> AC_DEFINE_UNQUOTED(SVN_CLIENT_DIFF3, "$SVN_CLIENT_DIFF3",
> [Define to be the full path to your GNU diff3 program])
>
> +dnl Determine whether diff3 supports the --diff-program arg.
> +AC_MSG_CHECKING([whether diff3 supports --diff-program arg])
> +touch A
> +$SVN_CLIENT_DIFF3 --diff-program=$SVN_CLIENT_DIFF A A A > /dev/null
> 2>&1
> +if test "$?" = "0"; then
> + AC_MSG_RESULT([yes])
> + AC_DEFINE_UNQUOTED(SVN_DIFF3_HAS_DIFF_PROGRAM_ARG, 1,
> + [Defined if diff3 supports the --diff-program argument])
> +else
> + AC_MSG_RESULT([no])
> +fi
> +rm -f A
"A" is not a very good choice for a temporary file name (my comments on
IRC notwithstanding). I'd either use a file that we know exists (for instance,
$abs_srcdir/README) or somehing more obscure, perhaps including the PID.
You could even use the name Autoconf generates for test programs.
> +
> dnl Since this is used only on Unix-y systems, define the path
> separator as '/'
> AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
> [Defined to be the path separator used on your local
> filesystem])
>
> Modified: trunk/subversion/libsvn_subr/io.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/io.c (original)
> +++ trunk/subversion/libsvn_subr/io.c Thu May 16 23:52:35 2002
> @@ -1232,7 +1232,11 @@
> int *exitcode,
> apr_pool_t *pool)
> {
> +#ifdef SVN_DIFF3_HAS_DIFF_PROGRAM_ARG
> + const char *args[14];
> +#else
> const char *args[13];
> +#endif
Lose this #ifdef; args can always have 14 elements. An extra pointer
is not _that_ much overhead.
> /* Labels fall back to sensible defaults if not specified. */
> if (mine_label == NULL)
> @@ -1256,10 +1260,18 @@
> case with "-E". */
> args[7] = "-L";
> args[8] = yours_label;
> +#ifdef SVN_DIFF3_HAS_DIFF_PROGRAM_ARG
> + args[9] = "--diff-program=" SVN_CLIENT_DIFF;
> + args[10] = mine;
> + args[11] = older;
> + args[12] = yours;
> + args[13] = NULL;
> +#else
> args[9] = mine;
> args[10] = older;
> args[11] = yours;
> args[12] = NULL;
> +#endif
>
> /* Run diff3, output the merged text into the scratch file. */
> SVN_ERR (svn_io_run_cmd (dir, SVN_CLIENT_DIFF3, args,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 17 15:00:39 2002