[vtk6] 01/09: Use system sqlite. (Closes: #750183)

Anton Gladky gladk at moszumanska.debian.org
Tue Jun 3 20:07:16 UTC 2014


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository vtk6.

commit d266ed9471356aa00bad035fe273816268e67dfa
Author: Anton Gladky <gladk at debian.org>
Date:   Tue Jun 3 20:04:59 2014 +0200

    Use system sqlite. (Closes: #750183)
---
 debian/patches/series                  |   1 +
 debian/patches/use_system_sqlite.patch | 522 +++++++++++++++++++++++++++++++++
 2 files changed, 523 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 7f6d950..c180e12 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ fix_libav10.patch
 fix_FTBFS_KWSys.patch
 fix_ftbfs_gcc49.patch
 use_system_xdmf.patch
+use_system_sqlite.patch
diff --git a/debian/patches/use_system_sqlite.patch b/debian/patches/use_system_sqlite.patch
new file mode 100644
index 0000000..5dc85c9
--- /dev/null
+++ b/debian/patches/use_system_sqlite.patch
@@ -0,0 +1,522 @@
+Description: Use system sqlite
+Author: Anton Gladky <gladk at debian.org>
+Bug-Debian: http://bugs.debian.org/750183
+Last-Update: 2014-06-03
+
+Index: vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteDatabase.cxx
+===================================================================
+--- vtk6-6.1.0+dfsg.orig/IO/SQL/vtkSQLiteDatabase.cxx
++++ vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteDatabase.cxx
+@@ -29,7 +29,7 @@
+ #include <vtksys/ios/fstream>
+ #include <vtksys/ios/sstream>
+ 
+-#include <vtksqlite/vtk_sqlite3.h>
++#include <sqlite3.h>
+ 
+ vtkStandardNewMacro(vtkSQLiteDatabase);
+ 
+@@ -307,15 +307,15 @@ bool vtkSQLiteDatabase::Open(const char*
+       }
+     }
+ 
+-  int result = vtk_sqlite3_open(this->DatabaseFileName, & (this->SQLiteInstance));
++  int result = sqlite3_open(this->DatabaseFileName, & (this->SQLiteInstance));
+ 
+-  if (result != VTK_SQLITE_OK)
++  if (result != SQLITE_OK)
+     {
+     vtkDebugMacro(<<"SQLite open() failed.  Error code is "
+                   << result << " and message is "
+-                  << vtk_sqlite3_errmsg(this->SQLiteInstance) );
++                  << sqlite3_errmsg(this->SQLiteInstance) );
+ 
+-    vtk_sqlite3_close(this->SQLiteInstance);
++    sqlite3_close(this->SQLiteInstance);
+     return false;
+     }
+   else
+@@ -334,8 +334,8 @@ void vtkSQLiteDatabase::Close()
+     }
+   else
+     {
+-    int result = vtk_sqlite3_close(this->SQLiteInstance);
+-    if (result != VTK_SQLITE_OK)
++    int result = sqlite3_close(this->SQLiteInstance);
++    if (result != SQLITE_OK)
+       {
+       vtkWarningMacro(<< "Close(): SQLite returned result code " << result);
+       }
+@@ -374,7 +374,7 @@ vtkStringArray * vtkSQLiteDatabase::GetT
+   if (!status)
+     {
+     vtkErrorMacro(<< "GetTables(): Database returned error: "
+-                  << vtk_sqlite3_errmsg(this->SQLiteInstance) );
++                  << sqlite3_errmsg(this->SQLiteInstance) );
+     query->Delete();
+     return this->Tables;
+     }
+@@ -403,7 +403,7 @@ vtkStringArray * vtkSQLiteDatabase::GetR
+   if (!status)
+     {
+     vtkErrorMacro(<< "GetRecord(" << table << "): Database returned error: "
+-                  << vtk_sqlite3_errmsg(this->SQLiteInstance) );
++                  << sqlite3_errmsg(this->SQLiteInstance) );
+     query->Delete();
+     return NULL;
+     }
+@@ -467,10 +467,10 @@ bool vtkSQLiteDatabase::ParseURL(const c
+ // ----------------------------------------------------------------------
+ bool vtkSQLiteDatabase::HasError()
+ {
+-  return (vtk_sqlite3_errcode(this->SQLiteInstance)!=VTK_SQLITE_OK);
++  return (sqlite3_errcode(this->SQLiteInstance)!=SQLITE_OK);
+ }
+ 
+ const char* vtkSQLiteDatabase::GetLastErrorText()
+ {
+-  return vtk_sqlite3_errmsg(this->SQLiteInstance);
++  return sqlite3_errmsg(this->SQLiteInstance);
+ }
+Index: vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteQuery.cxx
+===================================================================
+--- vtk6-6.1.0+dfsg.orig/IO/SQL/vtkSQLiteQuery.cxx
++++ vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteQuery.cxx
+@@ -25,7 +25,7 @@
+ #include "vtkVariant.h"
+ #include "vtkVariantArray.h"
+ 
+-#include <vtksqlite/vtk_sqlite3.h>
++#include <sqlite3.h>
+ 
+ #include <cassert>
+ 
+@@ -43,7 +43,7 @@ vtkSQLiteQuery::vtkSQLiteQuery()
+ {
+   this->Statement = NULL;
+   this->InitialFetch = true;
+-  this->InitialFetchResult=VTK_SQLITE_DONE;
++  this->InitialFetchResult=SQLITE_DONE;
+   this->LastErrorText = NULL;
+   this->TransactionInProgress = false;
+ }
+@@ -61,7 +61,7 @@ vtkSQLiteQuery::~vtkSQLiteQuery()
+     {
+     if (this->Database != NULL)
+       {
+-      vtk_sqlite3_finalize(this->Statement);
++      sqlite3_finalize(this->Statement);
+       this->Statement = NULL;
+       }
+     }
+@@ -131,8 +131,8 @@ bool vtkSQLiteQuery::SetQuery(const char
+   if (this->Statement)
+     {
+     vtkDebugMacro(<<"Finalizing old statement");
+-    int finalizeStatus = vtk_sqlite3_finalize(this->Statement);
+-    if (finalizeStatus != VTK_SQLITE_OK)
++    int finalizeStatus = sqlite3_finalize(this->Statement);
++    if (finalizeStatus != SQLITE_OK)
+       {
+       vtkWarningMacro(<<"SetQuery(): Finalize returned unexpected code "
+                       << finalizeStatus);
+@@ -151,19 +151,19 @@ bool vtkSQLiteQuery::SetQuery(const char
+       return false;
+       }
+ 
+-    vtk_sqlite3 *db = dbContainer->SQLiteInstance;
++    sqlite3 *db = dbContainer->SQLiteInstance;
+     const char *unused_statement;
+ 
+-    int prepareStatus = vtk_sqlite3_prepare_v2(db,
++    int prepareStatus = sqlite3_prepare_v2(db,
+                                                this->Query,
+                                                static_cast<int>(strlen(this->Query)),
+                                                &this->Statement,
+                                                &unused_statement);
+ 
+-    if (prepareStatus != VTK_SQLITE_OK)
++    if (prepareStatus != SQLITE_OK)
+       {
+-      this->SetLastErrorText(vtk_sqlite3_errmsg(db));
+-      vtkWarningMacro(<<"SetQuery(): vtk_sqlite3_prepare_v2() failed with error message "
++      this->SetLastErrorText(sqlite3_errmsg(db));
++      vtkWarningMacro(<<"SetQuery(): sqlite3_prepare_v2() failed with error message "
+                     << this->GetLastErrorText()
+                     << " on statement: '"
+                     << this->Query << "'");
+@@ -194,31 +194,31 @@ bool vtkSQLiteQuery::Execute()
+     }
+   else
+     {
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+ 
+   vtkDebugMacro(<<"Execute(): Query ready to execute.");
+ 
+   this->InitialFetch = true;
+-  int result = vtk_sqlite3_step(this->Statement);
++  int result = sqlite3_step(this->Statement);
+   this->InitialFetchResult = result;
+ 
+-  if (result == VTK_SQLITE_DONE)
++  if (result == SQLITE_DONE)
+     {
+     this->SetLastErrorText(NULL);
+     this->Active = true;
+     return true;
+     }
+-  else if (result != VTK_SQLITE_ROW)
++  else if (result != SQLITE_ROW)
+     {
+     vtkSQLiteDatabase *dbContainer =
+       vtkSQLiteDatabase::SafeDownCast(this->Database);
+     assert(dbContainer != NULL);
+ 
+-    vtk_sqlite3 *db = dbContainer->SQLiteInstance;
++    sqlite3 *db = dbContainer->SQLiteInstance;
+ 
+-    this->SetLastErrorText(vtk_sqlite3_errmsg(db));
+-    vtkDebugMacro(<< "Execute(): vtk_sqlite3_step() returned error message "
++    this->SetLastErrorText(sqlite3_errmsg(db));
++    vtkDebugMacro(<< "Execute(): sqlite3_step() returned error message "
+                   << this->GetLastErrorText());
+     this->Active = false;
+     return false;
+@@ -239,7 +239,7 @@ int vtkSQLiteQuery::GetNumberOfFields()
+     }
+   else
+     {
+-    return vtk_sqlite3_column_count(this->Statement);
++    return sqlite3_column_count(this->Statement);
+     }
+ }
+ 
+@@ -259,7 +259,7 @@ const char * vtkSQLiteQuery::GetFieldNam
+     }
+   else
+     {
+-    return vtk_sqlite3_column_name(this->Statement, column);
++    return sqlite3_column_name(this->Statement, column);
+     }
+ }
+ 
+@@ -279,22 +279,22 @@ int vtkSQLiteQuery::GetFieldType(int col
+     }
+   else
+     {
+-    switch (vtk_sqlite3_column_type(this->Statement, column))
++    switch (sqlite3_column_type(this->Statement, column))
+       {
+-      case VTK_SQLITE_INTEGER:
++      case SQLITE_INTEGER:
+         return VTK_INT;
+-      case VTK_SQLITE_FLOAT:
++      case SQLITE_FLOAT:
+         return VTK_FLOAT;
+-      case VTK_SQLITE_TEXT:
++      case SQLITE_TEXT:
+         return VTK_STRING;
+-      case VTK_SQLITE_BLOB:
++      case SQLITE_BLOB:
+         return VTK_STRING; // until we have a BLOB type of our own
+-      case VTK_SQLITE_NULL:
++      case SQLITE_NULL:
+         return VTK_VOID; // ??? what makes sense here?
+       default:
+       {
+       vtkErrorMacro(<<"GetFieldType(): Unknown data type "
+-                    << vtk_sqlite3_column_type(this->Statement, column)
++                    << sqlite3_column_type(this->Statement, column)
+                     <<" from SQLite.");
+       return VTK_VOID;
+       }
+@@ -315,7 +315,7 @@ bool vtkSQLiteQuery::NextRow()
+     {
+     vtkDebugMacro(<<"NextRow(): Initial fetch being handled.");
+     this->InitialFetch = false;
+-    if (this->InitialFetchResult == VTK_SQLITE_DONE)
++    if (this->InitialFetchResult == SQLITE_DONE)
+       {
+       return false;
+       }
+@@ -326,12 +326,12 @@ bool vtkSQLiteQuery::NextRow()
+     }
+   else
+     {
+-    int result = vtk_sqlite3_step(this->Statement);
+-    if (result == VTK_SQLITE_DONE)
++    int result = sqlite3_step(this->Statement);
++    if (result == SQLITE_DONE)
+       {
+       return false;
+       }
+-    else if (result == VTK_SQLITE_ROW)
++    else if (result == SQLITE_ROW)
+       {
+       return true;
+       }
+@@ -339,8 +339,8 @@ bool vtkSQLiteQuery::NextRow()
+       {
+       vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
+       assert(dbContainer != NULL);
+-      vtk_sqlite3 *db = dbContainer->SQLiteInstance;
+-      this->SetLastErrorText(vtk_sqlite3_errmsg(db));
++      sqlite3 *db = dbContainer->SQLiteInstance;
++      this->SetLastErrorText(sqlite3_errmsg(db));
+       vtkErrorMacro(<<"NextRow(): Database returned error code "
+                     << result << " with the following message: "
+                     << this->GetLastErrorText());
+@@ -366,33 +366,33 @@ vtkVariant vtkSQLiteQuery::DataValue(vtk
+     }
+   else
+     {
+-    switch (vtk_sqlite3_column_type(this->Statement, column))
++    switch (sqlite3_column_type(this->Statement, column))
+       {
+-      case VTK_SQLITE_INTEGER:
+-        return vtkVariant(vtk_sqlite3_column_int(this->Statement, column));
++      case SQLITE_INTEGER:
++        return vtkVariant(sqlite3_column_int(this->Statement, column));
+ 
+-      case VTK_SQLITE_FLOAT:
+-        return vtkVariant(vtk_sqlite3_column_double(this->Statement, column));
++      case SQLITE_FLOAT:
++        return vtkVariant(sqlite3_column_double(this->Statement, column));
+ 
+-      case VTK_SQLITE_TEXT:
++      case SQLITE_TEXT:
+       {
+       vtksys_ios::ostringstream str;
+-      str << vtk_sqlite3_column_text(this->Statement, column);
++      str << sqlite3_column_text(this->Statement, column);
+       return vtkVariant(vtkStdString(str.str()));
+       }
+ 
+-      case VTK_SQLITE_BLOB:
++      case SQLITE_BLOB:
+       {
+       // This is a hack ... by passing the BLOB to vtkStdString with an explicit
+       // byte count, we ensure that the string will store all of the BLOB's bytes,
+       // even if there are NULL values.
+ 
+       return vtkVariant(vtkStdString(
+-        static_cast<const char*>(vtk_sqlite3_column_blob(this->Statement, column)),
+-        vtk_sqlite3_column_bytes(this->Statement, column)));
++        static_cast<const char*>(sqlite3_column_blob(this->Statement, column)),
++        sqlite3_column_bytes(this->Statement, column)));
+       }
+ 
+-      case VTK_SQLITE_NULL:
++      case SQLITE_NULL:
+       default:
+         return vtkVariant();
+       }
+@@ -423,11 +423,11 @@ bool vtkSQLiteQuery::BeginTransaction()
+   vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
+   assert(dbContainer != NULL);
+ 
+-  vtk_sqlite3 *db = dbContainer->SQLiteInstance;
++  sqlite3 *db = dbContainer->SQLiteInstance;
+   char *errorMessage = NULL;
+-  int result = vtk_sqlite3_exec(db, BEGIN_TRANSACTION, NULL, NULL, &errorMessage);
++  int result = sqlite3_exec(db, BEGIN_TRANSACTION, NULL, NULL, &errorMessage);
+ 
+-  if (result == VTK_SQLITE_OK)
++  if (result == SQLITE_OK)
+     {
+     this->TransactionInProgress = true;
+     this->SetLastErrorText(NULL);
+@@ -451,7 +451,7 @@ bool vtkSQLiteQuery::CommitTransaction()
+ {
+   if (this->Statement)
+     {
+-    vtk_sqlite3_finalize(this->Statement);
++    sqlite3_finalize(this->Statement);
+     this->Statement = NULL;
+     }
+ 
+@@ -463,11 +463,11 @@ bool vtkSQLiteQuery::CommitTransaction()
+ 
+   vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
+   assert(dbContainer != NULL);
+-  vtk_sqlite3 *db = dbContainer->SQLiteInstance;
++  sqlite3 *db = dbContainer->SQLiteInstance;
+   char *errorMessage = NULL;
+-  int result = vtk_sqlite3_exec(db, COMMIT_TRANSACTION, NULL, NULL, &errorMessage);
++  int result = sqlite3_exec(db, COMMIT_TRANSACTION, NULL, NULL, &errorMessage);
+ 
+-  if (result == VTK_SQLITE_OK)
++  if (result == SQLITE_OK)
+     {
+     this->TransactionInProgress = false;
+     this->SetLastErrorText(NULL);
+@@ -499,11 +499,11 @@ bool vtkSQLiteQuery::RollbackTransaction
+ 
+   vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
+   assert(dbContainer != NULL);
+-  vtk_sqlite3 *db = dbContainer->SQLiteInstance;
++  sqlite3 *db = dbContainer->SQLiteInstance;
+   char *errorMessage = NULL;
+-  int result = vtk_sqlite3_exec(db, ROLLBACK_TRANSACTION, NULL, NULL, &errorMessage);
++  int result = sqlite3_exec(db, ROLLBACK_TRANSACTION, NULL, NULL, &errorMessage);
+ 
+-  if (result == VTK_SQLITE_OK)
++  if (result == SQLITE_OK)
+     {
+     this->TransactionInProgress = false;
+     this->SetLastErrorText(NULL);
+@@ -647,11 +647,11 @@ bool vtkSQLiteQuery::BindIntegerParamete
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+-  int status = vtk_sqlite3_bind_int(this->Statement, index+1, value);
++  int status = sqlite3_bind_int(this->Statement, index+1, value);
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_bind_int returned error: " << status;
+@@ -676,11 +676,11 @@ bool vtkSQLiteQuery::BindInt64Parameter(
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+-  int status = vtk_sqlite3_bind_int(this->Statement, index+1, static_cast<vtk_sqlite_int64>(value));
++  int status = sqlite3_bind_int(this->Statement, index+1, static_cast<sqlite_int64>(value));
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_bind_int64 returned error: " << status;
+@@ -705,12 +705,12 @@ bool vtkSQLiteQuery::BindDoubleParameter
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+ 
+-  int status = vtk_sqlite3_bind_double(this->Statement, index+1, value);
++  int status = sqlite3_bind_double(this->Statement, index+1, value);
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_bind_double returned error: " << status;
+@@ -734,12 +734,12 @@ bool vtkSQLiteQuery::BindStringParameter
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+ 
+-  int status = vtk_sqlite3_bind_text(this->Statement, index+1, value, length, VTK_SQLITE_TRANSIENT);
++  int status = sqlite3_bind_text(this->Statement, index+1, value, length, SQLITE_TRANSIENT);
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_bind_text returned error: " << status;
+@@ -763,17 +763,17 @@ bool vtkSQLiteQuery::BindBlobParameter(i
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+ 
+   int status =
+-    vtk_sqlite3_bind_blob(this->Statement,
++    sqlite3_bind_blob(this->Statement,
+                           index+1,
+                           data,
+                           length,
+-                          VTK_SQLITE_TRANSIENT);
++                          SQLITE_TRANSIENT);
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_bind_blob returned error: " << status;
+@@ -797,12 +797,12 @@ bool vtkSQLiteQuery::ClearParameterBindi
+   if (this->Active)
+     {
+     this->Active = false;
+-    vtk_sqlite3_reset(this->Statement);
++    sqlite3_reset(this->Statement);
+     }
+ 
+-  int status = vtk_sqlite3_clear_bindings(this->Statement);
++  int status = sqlite3_clear_bindings(this->Statement);
+ 
+-  if (status != VTK_SQLITE_OK)
++  if (status != SQLITE_OK)
+     {
+     vtksys_ios::ostringstream errormessage;
+     errormessage << "sqlite_clear_bindings returned error: " << status;
+Index: vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteQuery.h
+===================================================================
+--- vtk6-6.1.0+dfsg.orig/IO/SQL/vtkSQLiteQuery.h
++++ vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteQuery.h
+@@ -47,7 +47,7 @@
+ class vtkSQLiteDatabase;
+ class vtkVariant;
+ class vtkVariantArray;
+-struct vtk_sqlite3_stmt;
++struct sqlite3_stmt;
+ 
+ class VTKIOSQL_EXPORT vtkSQLiteQuery : public vtkSQLQuery
+ {
+@@ -155,7 +155,7 @@ private:
+   vtkSQLiteQuery(const vtkSQLiteQuery &); // Not implemented.
+   void operator=(const vtkSQLiteQuery &); // Not implemented.
+ 
+-  vtk_sqlite3_stmt *Statement;
++  sqlite3_stmt *Statement;
+   bool InitialFetch;
+   int InitialFetchResult;
+   char *LastErrorText;
+Index: vtk6-6.1.0+dfsg/ThirdParty/sqlite/CMakeLists.txt
+===================================================================
+--- vtk6-6.1.0+dfsg.orig/ThirdParty/sqlite/CMakeLists.txt
++++ vtk6-6.1.0+dfsg/ThirdParty/sqlite/CMakeLists.txt
+@@ -1,4 +1,3 @@
+ set(vtksqlite_THIRD_PARTY 1)
+-set(vtksqlite_LIBRARIES vtksqlite)
++set(vtksqlite_LIBRARIES sqlite3)
+ vtk_module_export_info()
+-add_subdirectory(vtksqlite)
+
+--- vtk6-6.1.0+dfsg.orig/IO/SQL/vtkSQLiteDatabase.h
++++ vtk6-6.1.0+dfsg/IO/SQL/vtkSQLiteDatabase.h
+@@ -49,7 +49,7 @@
+ class vtkSQLQuery;
+ class vtkSQLiteQuery;
+ class vtkStringArray;
+-struct vtk_sqlite3;
++struct sqlite3;
+ 
+ class VTKIOSQL_EXPORT vtkSQLiteDatabase : public vtkSQLDatabase
+ {
+@@ -147,7 +147,7 @@ protected:
+   virtual bool ParseURL(const char* url);
+ 
+ private:
+-  vtk_sqlite3 *SQLiteInstance;
++  sqlite3 *SQLiteInstance;
+ 
+   // We want this to be private, a user of this class
+   // should not be setting this for any reason

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vtk6.git



More information about the debian-science-commits mailing list