[Openvas-commits] r444 - trunk/openvas-server

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 17 21:23:27 CEST 2007


Author: jan
Date: 2007-10-17 21:23:26 +0200 (Wed, 17 Oct 2007)
New Revision: 444

Modified:
   trunk/openvas-server/ChangeLog
   trunk/openvas-server/TODO
   trunk/openvas-server/configure.in
Log:
* configure.in: Added version checks for openvas-libraries
and openvas-libnasl.

TODO: Removed wish for version checking.



Modified: trunk/openvas-server/ChangeLog
===================================================================
--- trunk/openvas-server/ChangeLog	2007-10-17 19:17:24 UTC (rev 443)
+++ trunk/openvas-server/ChangeLog	2007-10-17 19:23:26 UTC (rev 444)
@@ -1,3 +1,10 @@
+2007-10-17  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
+
+	* configure.in: Added version checks for openvas-libraries
+	and openvas-libnasl.
+
+	* TODO: Removed wish for version checking.
+
 2007-10-15  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
 
 	* TODO: Added some further items.

Modified: trunk/openvas-server/TODO
===================================================================
--- trunk/openvas-server/TODO	2007-10-17 19:17:24 UTC (rev 443)
+++ trunk/openvas-server/TODO	2007-10-17 19:23:26 UTC (rev 444)
@@ -1,7 +1,5 @@
 2007-10-15  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
 
-	* Add Minimum version check for openvas-libraries and openvas-libnasl
-
 	* Analyse/discuss in detail whether it makes send to keep the feature to
 	upload plugins. It looks like a serious security problem to allow this.
 

Modified: trunk/openvas-server/configure.in
===================================================================
--- trunk/openvas-server/configure.in	2007-10-17 19:17:24 UTC (rev 443)
+++ trunk/openvas-server/configure.in	2007-10-17 19:23:26 UTC (rev 444)
@@ -43,6 +43,9 @@
 AC_INIT(.root-dir)
 AC_REVISION($Revision$)dnl
 
+NEED_OPENVASLIBS_VERSION=1.0.0
+NEED_OPENVASLIBNASL_VERSION=0.9.1
+
 dnl version stuff -- jordan
 save_IFS="${IFS}"
 IFS=.
@@ -110,6 +113,46 @@
 "*** openvas-libraries is not installed ! You need to install it before you"
 "compile openvas-server.")
 
+OPENVASLIBS_VERSION=`$LIBOPENVASCONFIG --version`
+
+OPENVASLIBS_MAJOR=`echo $OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+OPENVASLIBS_MINOR=`echo $OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+OPENVASLIBS_PATCH=`echo $OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+REQ_OPENVASLIBS_MAJOR=`echo $NEED_OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+REQ_OPENVASLIBS_MINOR=`echo $NEED_OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+REQ_OPENVASLIBS_PATCH=`echo $NEED_OPENVASLIBS_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+
+
+ok=no
+if test "$OPENVASLIBS_MAJOR" -gt "$REQ_OPENVASLIBS_MAJOR"; then
+  ok=yes
+else
+  if test "$OPENVASLIBS_MAJOR" -eq "$REQ_OPENVASLIBS_MAJOR"; then
+    if test "$OPENVASLIBS_MINOR" -gt "$REQ_OPENVASLIBS_MINOR"; then
+      ok=yes
+    else
+      if test "$OPENVASLIBS_MINOR" -eq "$REQ_OPENVASLIBS_MINOR"; then
+        if test "$OPENVASLIBS_PATCH" -ge "$REQ_OPENVASLIBS_PATCH"; then
+          ok=yes
+        fi
+      fi
+    fi
+  fi
+fi
+if test $ok = no; then
+AC_ERROR(
+openvas-libraries $OPENVASLIBS_VERSION too old.
+Minimum required is $NEED_OPENVASLIBS_VERSION .
+)
+fi
+
+
 AC_PATH_PROG(OPENVASLIBNASLCONFIG, openvas-libnasl-config,,$XPATH)
 
 test "x$OPENVASLIBNASLCONFIG" = x &&  AC_ERROR(""
@@ -117,7 +160,45 @@
 "*** openvas-libnasl is not installed ! You need to install it before you "
 "compile openvas-server.")
 
+OPENVASLIBNASL_VERSION=`$OPENVASLIBNASLCONFIG --version`
 
+OPENVASLIBNASL_MAJOR=`echo $OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+OPENVASLIBNASL_MINOR=`echo $OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+OPENVASLIBNASL_PATCH=`echo $OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+REQ_OPENVASLIBNASL_MAJOR=`echo $NEED_OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+REQ_OPENVASLIBNASL_MINOR=`echo $NEED_OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+REQ_OPENVASLIBNASL_PATCH=`echo $NEED_OPENVASLIBNASL_VERSION | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+
+
+ok=no
+if test "$OPENVASLIBNASL_MAJOR" -gt "$REQ_OPENVASLIBNASL_MAJOR"; then
+  ok=yes
+else
+  if test "$OPENVASLIBNASL_MAJOR" -eq "$REQ_OPENVASLIBNASL_MAJOR"; then
+    if test "$OPENVASLIBNASL_MINOR" -gt "$REQ_OPENVASLIBNASL_MINOR"; then
+      ok=yes
+    else
+      if test "$OPENVASLIBNASL_MINOR" -eq "$REQ_OPENVASLIBNASL_MINOR"; then
+        if test "$OPENVASLIBNASL_PATCH" -ge "$REQ_OPENVASLIBNASL_PATCH"; then
+          ok=yes
+        fi
+      fi
+    fi
+  fi
+fi
+if test $ok = no; then
+AC_ERROR(
+openvas-libnasl $OPENVASLIBNASL_VERSION too old.
+Minimum required is $NEED_OPENVASLIBNASL_VERSION .
+)
+fi
+
 OVSCFLAGS="`$LIBOPENVASCONFIG --cflags`"
 NASLCFLAGS="`$OPENVASLIBNASLCONFIG --cflags`"
 



More information about the Openvas-commits mailing list