[Openvas-commits] r6259 - in trunk/openvas-manager: . doc src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Dec 25 21:48:55 CET 2009


Author: mattm
Date: 2009-12-25 21:48:52 +0100 (Fri, 25 Dec 2009)
New Revision: 6259

Modified:
   trunk/openvas-manager/CMakeLists.txt
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/doc/CMakeLists.txt
   trunk/openvas-manager/src/CMakeLists.txt
   trunk/openvas-manager/src/tasks_sql.h
Log:
	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): New variable.

	* doc/CMakeLists.txt: Add database version to db PNG and HTML.

	* src/CMakeLists.txt: Pass OPENVASMD_DATABASE_VERSION to compiler.

	* src/tasks_sql.h: Replace DATABASE_VERSION with
	OPENVASMD_DATABASE_VERSION.

Modified: trunk/openvas-manager/CMakeLists.txt
===================================================================
--- trunk/openvas-manager/CMakeLists.txt	2009-12-25 20:29:04 UTC (rev 6258)
+++ trunk/openvas-manager/CMakeLists.txt	2009-12-25 20:48:52 UTC (rev 6259)
@@ -94,6 +94,8 @@
 
 ## Variables
 
+SET (OPENVASMD_DATABASE_VERSION 8)
+
 set (CMAKE_BUILD                Debug)
 set (CMAKE_VERBOSE_MAKEFILE     ON)
 

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2009-12-25 20:29:04 UTC (rev 6258)
+++ trunk/openvas-manager/ChangeLog	2009-12-25 20:48:52 UTC (rev 6259)
@@ -1,5 +1,16 @@
 2009-12-25  Matthew Mundell <matthew.mundell at intevation.de>
 
+	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): New variable.
+
+	* doc/CMakeLists.txt: Add database version to db PNG and HTML.
+
+	* src/CMakeLists.txt: Pass OPENVASMD_DATABASE_VERSION to compiler.
+
+	* src/tasks_sql.h: Replace DATABASE_VERSION with
+	OPENVASMD_DATABASE_VERSION.
+
+2009-12-25  Matthew Mundell <matthew.mundell at intevation.de>
+
 	* doc/db_postgres.sql (nvt_selectors): Add id field.
 	(targets): Add id field.
 	(tasks): Describe description.  Refer to config and target by id.

Modified: trunk/openvas-manager/doc/CMakeLists.txt
===================================================================
--- trunk/openvas-manager/doc/CMakeLists.txt	2009-12-25 20:29:04 UTC (rev 6258)
+++ trunk/openvas-manager/doc/CMakeLists.txt	2009-12-25 20:48:52 UTC (rev 6259)
@@ -115,7 +115,7 @@
 if (SQLT-DIAGRAM_EXECUTABLE)
   add_custom_command (OUTPUT db.png
 					  COMMAND sh
-					  ARGS -c \"${SQLT-DIAGRAM_EXECUTABLE} --color --title=\\\"Manager database\\\" -d PostgreSQL db_postgres.sql -o db.png\;\"
+					  ARGS -c \"${SQLT-DIAGRAM_EXECUTABLE} --color --title=\\\"Manager database \(version ${OPENVASMD_DATABASE_VERSION}\)\\\" -d PostgreSQL db_postgres.sql -o db.png\;\"
 					  DEPENDS db_postgres.sql)
 else (SQLT_EXECUTABLE)
   add_custom_command (OUTPUT db.png
@@ -126,7 +126,7 @@
 if (SQLT_EXECUTABLE)
   add_custom_command (OUTPUT .built-html_db
 					  COMMAND sh
-					  ARGS -c \"${SQLT_EXECUTABLE} --from PostgreSQL --to HTML --pretty --title=\\\"Manager database\\\" db_postgres.sql > db.html && touch .built-html_db\;\"
+					  ARGS -c \"${SQLT_EXECUTABLE} --from PostgreSQL --to HTML --pretty --title=\\\"Manager database \(version ${OPENVASMD_DATABASE_VERSION}\)\\\" db_postgres.sql > db.html && touch .built-html_db\;\"
 					  DEPENDS db_postgres.sql)
 else (SQLT_EXECUTABLE)
   add_custom_command (OUTPUT .built-html_db

Modified: trunk/openvas-manager/src/CMakeLists.txt
===================================================================
--- trunk/openvas-manager/src/CMakeLists.txt	2009-12-25 20:29:04 UTC (rev 6258)
+++ trunk/openvas-manager/src/CMakeLists.txt	2009-12-25 20:48:52 UTC (rev 6259)
@@ -88,6 +88,7 @@
   add_definitions (-DOPENVASMD_VERSION=\\\"${OPENVASMD_VERSION}\\\")
 endif (OPENVASMD_VERSION)
 
+add_definitions (-DOPENVASMD_DATABASE_VERSION=${OPENVASMD_DATABASE_VERSION})
 add_definitions (-DOPENVAS_OS_NAME=\\\"${CMAKE_SYSTEM}\\\")
 add_definitions (-DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\")
 

Modified: trunk/openvas-manager/src/tasks_sql.h
===================================================================
--- trunk/openvas-manager/src/tasks_sql.h	2009-12-25 20:29:04 UTC (rev 6258)
+++ trunk/openvas-manager/src/tasks_sql.h	2009-12-25 20:48:52 UTC (rev 6259)
@@ -35,11 +35,6 @@
 #endif
 
 /**
- * @brief Version of the database schema.
- */
-#define DATABASE_VERSION 8
-
-/**
  * @brief NVT selector type for "all" rule.
  */
 #define NVT_SELECTOR_TYPE_ALL 0
@@ -648,11 +643,12 @@
  * manager will automatically add a table if it is missing from the database.
  *
  *  - Ensure that the ChangeLog notes the changes to the database and
- *    the increase of DATABASE_VERSION, with an entry like
+ *    the increase of OPENVASMD_DATABASE_VERSION, with an entry like
  *
- *        * src/tasks_sql.h (DATABASE_VERSION): Increase to 6, for...
- *        (init_manage): Add new column...
+ *        * CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 6, for...
  *
+ *        * src/tasks_sql.h (init_manage): Add new column...
+ *
  *  - Add the migrator function in the style of the others.  In particular,
  *    the function must check the version, do the modification and then set
  *    the new version, all inside an exclusive transaction.
@@ -747,7 +743,7 @@
 int
 manage_db_supported_version ()
 {
-  return DATABASE_VERSION;
+  return OPENVASMD_DATABASE_VERSION;
 }
 
 /**
@@ -2954,14 +2950,15 @@
   if (nvt_cache_mode)
     {
       if (database_version
-          && strcmp (database_version, G_STRINGIFY (DATABASE_VERSION)))
+          && strcmp (database_version,
+                     G_STRINGIFY (OPENVASMD_DATABASE_VERSION)))
         {
           g_message ("%s: database version of database: %s\n",
                      __FUNCTION__,
                      database_version);
           g_message ("%s: database version supported by manager: %s\n",
                      __FUNCTION__,
-                     G_STRINGIFY (DATABASE_VERSION));
+                     G_STRINGIFY (OPENVASMD_DATABASE_VERSION));
           g_free (database_version);
           return -2;
         }
@@ -2976,14 +2973,15 @@
 
       if (database_version)
         {
-          if (strcmp (database_version, G_STRINGIFY (DATABASE_VERSION)))
+          if (strcmp (database_version,
+                      G_STRINGIFY (OPENVASMD_DATABASE_VERSION)))
             {
               g_message ("%s: database version of database: %s\n",
                          __FUNCTION__,
                          database_version);
               g_message ("%s: database version supported by manager: %s\n",
                          __FUNCTION__,
-                         G_STRINGIFY (DATABASE_VERSION));
+                         G_STRINGIFY (OPENVASMD_DATABASE_VERSION));
               g_free (database_version);
               return -2;
             }
@@ -3013,7 +3011,7 @@
 
   /* Ensure the version is set. */
 
-  set_db_version (DATABASE_VERSION);
+  set_db_version (OPENVASMD_DATABASE_VERSION);
 
   /* Ensure the special "om" user exists. */
 



More information about the Openvas-commits mailing list