subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Bug in subversion sed usage inside configure (Solaris)
Date Thu, 06 Aug 2015 10:13:07 GMT
This has been observed for Subversion 1.9.0, but visual inspection shows 
the same in the head revisions of at least 1.9, 1.8 and 1.7. Trunk 
already has a fix, but a bigger and different one than the one proposed 
here. Moving to the trunk fix would be fine (it is not in 1.9 STATUS 
currently), but if you think that would be a change too big, the 
following is simpler:

Subversion 1.9.0 uses the following sed command in configure:

   $SED -e 's@^.*/\([0-9.]*\)\(.*$\)@\1@ ; 1q'

On Solaris there are two sed incarnations installed by default, 
/usr/bin/sed and /usr/xpg4/bin/sed. Both of them do not accept this use 
and return with:

   sed: command garbled: s@^.*/\([0-9.]*\)\(.*$\)@\1@ ; 1q

The reasons is the space before "; 1q". Removing it fixes the "garbled". 
But still the command does not do what was intended. It will return 
(example)

   Server version: Apache/2.4.4 (Unix)

instead of the expected

   2.4.4

The reason for this failure is the "$" character in the sed command 
which is not known to the Solaris implementation.

I suggest to use the following easier pattern instead, which would also 
work for GNU sed and should also work on all other platforms:

   $SED -e 's@.*/\([0-9.]*\).*@\1@; 1q'

Motivation:

- Space character before ";" is not needed and harmful at least on Solaris

- Caret "^" and Dollar sign "$" before resp. after ".*" is implicit and 
at least the Dollar sign harms on Solaris

- The second capture "\(...\)" is not used so can be removed

This is the suggested patch for 1.9 head:

--- build/ac-macros/apache.m4	2015-07-27 02:23:40.000000000 +0200
+++ build/ac-macros/apache.m4	2015-08-06 12:04:47.114473000 +0200
@@ -166,7 +166,7 @@
      if ! test -e $HTTPD ; then
        HTTPD="`$APXS -q bindir`/`$APXS -q PROGNAME`"
      fi
-    HTTPD_VERSION=["`$HTTPD -v | $SED -e 's@^.*/\([0-9.]*\)\(.*$\)@\1@ 
; 1q'`"]
+    HTTPD_VERSION=["`$HTTPD -v | $SED -e 's@.*/\([0-9.]*\).*@\1@; 1q'`"]
      AC_ARG_ENABLE(broken-httpd-auth,
        AS_HELP_STRING([--enable-broken-httpd-auth],
                       [Allow building against httpd 2.4 with broken auth]),


Regards,

Rainer

Mime
View raw message