You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pe...@apache.org on 2011/06/15 18:43:24 UTC
svn commit: r1136114 - /subversion/trunk/configure.ac
Author: peters
Date: Wed Jun 15 16:43:24 2011
New Revision: 1136114
URL: http://svn.apache.org/viewvc?rev=1136114&view=rev
Log:
* configure.ac: Followup r1134219: Use 'cmp -s' instead of 'diff' to
detect changes to svn_private_config.h. Take advantage of the fact
that cmp -s produces no output even if a file does not exist.
Use a temp variable to shorten the lines further.
Modified:
subversion/trunk/configure.ac
Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1136114&r1=1136113&r2=1136114&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Wed Jun 15 16:43:24 2011
@@ -1299,13 +1299,10 @@ AC_SUBST(INCLUDE_OUTPUTS)
AC_CONFIG_HEADERS(subversion/svn_private_config.h.tmp:subversion/svn_private_config.h.in)
AC_CONFIG_COMMANDS([svn_private_config.h.tmp],
- [$SED -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" subversion/svn_private_config.h.tmp > subversion/svn_private_config.h.tmp.new
- if test -e subversion/svn_private_config.h && diff subversion/svn_private_config.h subversion/svn_private_config.h.tmp.new >/dev/null ; then
- rm -f subversion/svn_private_config.h.tmp.new
- else
- mv -f subversion/svn_private_config.h.tmp.new subversion/svn_private_config.h
- fi
- rm -f subversion/svn_private_config.h.tmp],
+ [svn_cf=subversion/svn_private_config.h;
+ $SED -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" $svn_cf.tmp > $svn_cf.tmp.new
+ cmp -s $svn_cf.tmp.new $svn_cf || mv -f $svn_cf.tmp.new $svn_cf
+ rm -f $svn_cf.tmp.new $svn_cf.tmp)],
[SED="$SED"
SVN_DB_HEADER="$SVN_DB_HEADER"])
AC_CONFIG_FILES([Makefile])
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2011-06-15 at 13:28 -0400, Philip Martin wrote:
> Do they all support -s?
cmp -s is one of the most portable Unix command invocations in existence
(from general knowledge; I can't give a reference).
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Stefan Sperling wrote on Wed, Jun 15, 2011 at 19:54:48 +0200:
> On Wed, Jun 15, 2011 at 06:28:28PM +0100, Philip Martin wrote:
> > Stefan Sperling <st...@elego.de> writes:
> > >> Is cmp as portable as diff? Is it always available with the same
> > >> behaviour? autoconf generates calls to diff, so we know that using diff
> > >> will work anywhere that autoconf works. As far as I can tell autoconf
> > >> doesn't use cmp.
> > >
> > >>From the cmp man page:
> > >
> > > HISTORY
> > > "A cmp command appeared in Version 1 AT&T UNIX."
> > >
> > > I would say that's ancient enough to be supported anywhere :)
> >
> > Do they all support -s?
>
> Very likely. The -s option was present in Unix 7th Edition:
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/cmp.c
> It was likely also in 4.4BSD or earlier. NetBSD had the option in 1995.
And Peter observed on IRC that even cmp's that don't support -s will
still DTRT. (eg, if they error out, the non-zero exit code would
signify a no-op file replace)
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Stefan Sperling <st...@elego.de>.
On Wed, Jun 15, 2011 at 06:28:28PM +0100, Philip Martin wrote:
> Stefan Sperling <st...@elego.de> writes:
> >> Is cmp as portable as diff? Is it always available with the same
> >> behaviour? autoconf generates calls to diff, so we know that using diff
> >> will work anywhere that autoconf works. As far as I can tell autoconf
> >> doesn't use cmp.
> >
> >>From the cmp man page:
> >
> > HISTORY
> > "A cmp command appeared in Version 1 AT&T UNIX."
> >
> > I would say that's ancient enough to be supported anywhere :)
>
> Do they all support -s?
Very likely. The -s option was present in Unix 7th Edition:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/cmp.c
It was likely also in 4.4BSD or earlier. NetBSD had the option in 1995.
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Philip Martin <ph...@wandisco.com>.
Stefan Sperling <st...@elego.de> writes:
> On Wed, Jun 15, 2011 at 06:11:31PM +0100, Philip Martin wrote:
>> peters@apache.org writes:
>>
>> > Author: peters
>> > Date: Wed Jun 15 16:43:24 2011
>> > New Revision: 1136114
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1136114&view=rev
>> > Log:
>> > * configure.ac: Followup r1134219: Use 'cmp -s' instead of 'diff' to
>> > detect changes to svn_private_config.h. Take advantage of the fact
>> > that cmp -s produces no output even if a file does not exist.
>> > Use a temp variable to shorten the lines further.
>>
>> Is cmp as portable as diff? Is it always available with the same
>> behaviour? autoconf generates calls to diff, so we know that using diff
>> will work anywhere that autoconf works. As far as I can tell autoconf
>> doesn't use cmp.
>
>>From the cmp man page:
>
> HISTORY
> "A cmp command appeared in Version 1 AT&T UNIX."
>
> I would say that's ancient enough to be supported anywhere :)
Do they all support -s?
> Oh, and it also conforms to POSIX.
configure is supposed to work on anything that is "good enough". I
don't understand why we would choose to use cmp here, when diff is used
in the rest of the script.
--
Philip
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Stefan Sperling <st...@elego.de>.
On Wed, Jun 15, 2011 at 06:11:31PM +0100, Philip Martin wrote:
> peters@apache.org writes:
>
> > Author: peters
> > Date: Wed Jun 15 16:43:24 2011
> > New Revision: 1136114
> >
> > URL: http://svn.apache.org/viewvc?rev=1136114&view=rev
> > Log:
> > * configure.ac: Followup r1134219: Use 'cmp -s' instead of 'diff' to
> > detect changes to svn_private_config.h. Take advantage of the fact
> > that cmp -s produces no output even if a file does not exist.
> > Use a temp variable to shorten the lines further.
>
> Is cmp as portable as diff? Is it always available with the same
> behaviour? autoconf generates calls to diff, so we know that using diff
> will work anywhere that autoconf works. As far as I can tell autoconf
> doesn't use cmp.
>From the cmp man page:
HISTORY
"A cmp command appeared in Version 1 AT&T UNIX."
I would say that's ancient enough to be supported anywhere :)
Oh, and it also conforms to POSIX.
Re: svn commit: r1136114 - /subversion/trunk/configure.ac
Posted by Philip Martin <ph...@wandisco.com>.
peters@apache.org writes:
> Author: peters
> Date: Wed Jun 15 16:43:24 2011
> New Revision: 1136114
>
> URL: http://svn.apache.org/viewvc?rev=1136114&view=rev
> Log:
> * configure.ac: Followup r1134219: Use 'cmp -s' instead of 'diff' to
> detect changes to svn_private_config.h. Take advantage of the fact
> that cmp -s produces no output even if a file does not exist.
> Use a temp variable to shorten the lines further.
Is cmp as portable as diff? Is it always available with the same
behaviour? autoconf generates calls to diff, so we know that using diff
will work anywhere that autoconf works. As far as I can tell autoconf
doesn't use cmp.
--
Philip