You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2010/01/05 11:57:55 UTC

svn commit: r895984 - /tomcat/native/trunk/native/build/tcnative.m4

Author: rjung
Date: Tue Jan  5 10:57:52 2010
New Revision: 895984

URL: http://svn.apache.org/viewvc?rev=895984&view=rev
Log:
Get rid of nested version test by formatting
version number as one big decimal.

Modified:
    tomcat/native/trunk/native/build/tcnative.m4

Modified: tomcat/native/trunk/native/build/tcnative.m4
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=895984&r1=895983&r2=895984&view=diff
==============================================================================
--- tomcat/native/trunk/native/build/tcnative.m4 (original)
+++ tomcat/native/trunk/native/build/tcnative.m4 Tue Jan  5 10:57:52 2010
@@ -32,16 +32,9 @@
   fi
   sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
   tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
-  if test "${1}" -lt "1"; then
+  decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
+  if test "${decimal_apr_version}" -lt "0101003"; then
     AC_MSG_ERROR(You need APR version 1.3.3 or newer installed.)
-  else
-    if test "${2}" -lt "3"; then
-      AC_MSG_ERROR(You need APR version 1.3.3 or newer installed.)
-    else
-      if test "${3}" -lt "3"; then
-        AC_MSG_ERROR(You need APR version 1.3.3 or newer installed.)
-      fi
-    fi
   fi
 
   APR_BUILD_DIR="`$apr_config --installbuilddir`"



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r895984 - /tomcat/native/trunk/native/build/tcnative.m4

Posted by sebb <se...@gmail.com>.
On 05/01/2010, Mladen Turk <mt...@apache.org> wrote:
> On 01/05/2010 11:57 AM, rjung@apache.org wrote:
>
> > Author: rjung
> > Get rid of nested version test by formatting
> > version number as one big decimal.
> >
> > +  decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
> > +  if test "${decimal_apr_version}" -lt "0101003"; then
> >
>
>  You should not quote the arithmetic ops though.
>  Also 0101003 is exactly what? 1.1.3 ?

For added safety the format could also be used to generate the comparator.

>  And the format should be %d%d%03d
>  APR has 1-1-N digits in formats.
>  There will never be thing like APR 1.11.X :)
>
>
>  Regards
>  --
>  ^TM
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r895984 - /tomcat/native/trunk/native/build/tcnative.m4

Posted by Mladen Turk <mt...@apache.org>.
On 01/05/2010 11:57 AM, rjung@apache.org wrote:
> Author: rjung
> Get rid of nested version test by formatting
> version number as one big decimal.
>
> +  decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
> +  if test "${decimal_apr_version}" -lt "0101003"; then

You should not quote the arithmetic ops though.
Also 0101003 is exactly what? 1.1.3 ?

And the format should be %d%d%03d
APR has 1-1-N digits in formats.
There will never be thing like APR 1.11.X :)


Regards
-- 
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org