You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by br...@xbc.nu on 2002/05/17 11:39:01 UTC

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

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

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by Philip Martin <ph...@codematters.co.uk>.
Philip Martin <ph...@codematters.co.uk> writes:

> Or just use the current directory: 'diff . .'

Oh, what rubbish I write sometimes :-(

-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by Philip Martin <ph...@codematters.co.uk>.
brane@xbc.nu writes:

> > 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.

Or just use the current directory: 'diff . .'

-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by br...@xbc.nu.
Quoting Philip Martin <ph...@codematters.co.uk>:

> brane@xbc.nu writes:
> 
> > > 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.
> 
> Put my brain in gear this time...
> 
> How about $0?   diff3 ${0} ${0} ${0}

Oooh, /me likes, /me likes!
I say, the most brilliant ideas turn out to be the obvious ones, as usual.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by Philip Martin <ph...@codematters.co.uk>.
Michael Wood <mw...@its.uct.ac.za> writes:

> > How about $0?   diff3 ${0} ${0} ${0}
> 
> How about: diff3 "${0}" "${0}" "${0}"

To support spaces in directory names I suppose?  Fine in principle,
but I don't think configure will get this far. Let's see

%  ../a\ b/configure
../a b/configure: test: ../a: binary operator expected
../a b/configure: test: ../a: binary operator expected
configure: error: cannot find install-sh or install.sh in ac-helpers ../a b/ac-helpers

That's a mere 8000 lines before the diff3 test.  I suppose you could
try to fix the whole thing, but unless you keep exercising it such
support is likely to break again.

-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by Michael Wood <mw...@its.uct.ac.za>.
On Fri, May 17, 2002 at 12:54:40PM +0100, Philip Martin wrote:
> brane@xbc.nu writes:
> 
> > > 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.
> 
> Put my brain in gear this time...
> 
> How about $0?   diff3 ${0} ${0} ${0}

How about: diff3 "${0}" "${0}" "${0}"

:)

-- 
Michael Wood <mw...@its.uct.ac.za>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 1973 - trunk trunk/subversion/libsvn_subr

Posted by Philip Martin <ph...@codematters.co.uk>.
brane@xbc.nu writes:

> > 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.

Put my brain in gear this time...

How about $0?   diff3 ${0} ${0} ${0}


-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org