apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: [PATCH] Layout process
Date Wed, 04 Jun 2003 20:08:32 GMT
On Fri, May 30, 2003 at 09:23:11PM +0200, Sascha Schumann wrote:
>     Hi there,
> 
>     the sed on IRIX does not cooperate with the complex sed
>     expressions used to cut out and transform the proper layout
>     section.  Thus configure has been failing since 2.0.40 or
>     so on IRIX.
> 
>     Therefore I propose a simpler solution in the form of a 3
>     line awk script which provides the same functionality in a
>     less obscure way.

This is definitely more readable, and seems to work fine here, good to
see someone looked into this problem.  Nobody else has cared about
fixing the IRIX build for months (there's a PR on this) so I'd say go
ahead and commit this.  I think you're missing a semi-colon on the {
print ... } line, but I don't suppose awk really minds.

joe

> --- build/apr_common.m4~	Fri May 30 18:29:34 2003
> +++ build/apr_common.m4	Fri May 30 18:53:46 2003
> @@ -756,14 +756,13 @@
>      exit 1
>    fi
>    pldconf=./config.pld
> -  changequote({,})
> -  sed -e "1s/[ 	]*<[lL]ayout[ 	]*$2[ 	]*>[ 	]*//;t" \
> -      -e "1,/[ 	]*<[lL]ayout[ 	]*$2[ 	]*>[ 	]*/d" \
> -      -e '/[ 	]*<\/Layout>[ 	]*/,$d' \
> -      -e "s/^[ 	]*//g" \
> -      -e "s/:[ 	]*/=\'/g" \
> -      -e "s/[ 	]*$/'/g" \
> -      $1 > $pldconf
> +  changequote({{,}})
> +  awk -v layout=$2 '                                                         \
> +        /<[Ll]ayout/ { if ({{$}}2 == layout ">") ok=1; next; }               \
> +        ok == 1 && /<\/Layout>/ { exit; }                            
       \
> +        ok == 1 { print {{substr}}({{$}}1,1,length({{$}}1)-1) "=\"" {{$}}2 "\"" } '
\
> +        < $1 > $pldconf
> +
>    layout_name=$2
>    if test ! -s $pldconf; then
>      echo "** Error: unable to find layout $layout_name"
> @@ -771,6 +770,7 @@
>    fi
>    . $pldconf
>    rm $pldconf
> +  changequote({,})
>    for var in prefix exec_prefix bindir sbindir libexecdir mandir \
>               sysconfdir datadir includedir localstatedir runtimedir \
>               logfiledir libdir installbuilddir libsuffix $3; do


Mime
View raw message