tags 441900 + patch pending
tags 495100 + patch pending
thanks

Hi Francois,

here is my sqlitebrowser NMU (versioned as 1.3-2.1) fixing the FTBFS
and dropping the embedded sqlite. This, in particular the latter, has
been checked with the release team. Please do not upload changes that
could deter the releasability of sqlitebrowser before the NMU has
migrated to lenny.
Note that IMO you should have pulled the embedded copy yourself and
not just have tagged the bug upstream and letting it sit that long.
Duplicate code is a concern for Debian more than upstream.

Kind Regards

T.

diff -u sqlitebrowser-1.3/debian/changelog sqlitebrowser-1.3/debian/changelog
--- sqlitebrowser-1.3/debian/changelog
+++ sqlitebrowser-1.3/debian/changelog
@@ -1,3 +1,16 @@
+sqlitebrowser (1.3-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/rules Preserve permissions when backing up Makefile in build
+    target, so it can be cleaned up when building is done with sudo.
+    Bug, analyis, and patch by Thiemo Seufer, thanks!
+    Closes: #495100
+  * build against Debian libsqlite3. Wanting to use one or two internal
+    functions is no excuse for embedding the whole thing.
+    Closes: #441900
+
+ -- Thomas Viehmann <[EMAIL PROTECTED]>  Tue, 07 Oct 2008 22:17:48 +0200
+
 sqlitebrowser (1.3-2) unstable; urgency=low
 
   * source.lintian-overrides: added lintian overrides for CVS directories
diff -u sqlitebrowser-1.3/debian/control sqlitebrowser-1.3/debian/control
--- sqlitebrowser-1.3/debian/control
+++ sqlitebrowser-1.3/debian/control
@@ -2,7 +2,7 @@
 Section: devel
 Priority: extra
 Maintainer: François Févotte <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 5), qt3-dev-tools, libqt3-headers, libqt3-mt-dev
+Build-Depends: debhelper (>= 5), qt3-dev-tools, libqt3-headers, libqt3-mt-dev, 
libsqlite3-dev
 Standards-Version: 3.7.2
 
 Package: sqlitebrowser
diff -u sqlitebrowser-1.3/debian/rules sqlitebrowser-1.3/debian/rules
--- sqlitebrowser-1.3/debian/rules
+++ sqlitebrowser-1.3/debian/rules
@@ -18,7 +18,7 @@
 # Backup original files
 backup: Makefile_orig
 Makefile_orig:
-       cp Makefile Makefile_orig
+       cp -p Makefile Makefile_orig
 
 configure: configure-stamp
 configure-stamp: backup
only in patch2:
unchanged:
--- sqlitebrowser-1.3.orig/sqlitedbbrowser.pro
+++ sqlitebrowser-1.3/sqlitedbbrowser.pro
@@ -1 +1 @@
-TEMPLATE    =  subdirs

SUBDIRS =       sqlitebrowser/sqlite_source \
                sqlitebrowser



\ No newline at end of file
+TEMPLATE    =  subdirs

SUBDIRS =       sqlitebrowser



only in patch2:
unchanged:
--- sqlitebrowser-1.3.orig/sqlitebrowser/sqlitebrowser.pro
+++ sqlitebrowser-1.3/sqlitebrowser/sqlitebrowser.pro
@@ -47,7 +47,7 @@
   UI_DIR = .ui
   MOC_DIR = .moc
   OBJECTS_DIR = .obj
-  LIBS += ./sqlite_source/libsqlite_source.a
+  LIBS += -lsqlite3
 }
 win32 {
   RC_FILE = winapp.rc
only in patch2:
unchanged:
--- sqlitebrowser-1.3.orig/sqlitebrowser/sqlitedb.h
+++ sqlitebrowser-1.3/sqlitebrowser/sqlitedb.h
@@ -1 +1 @@
-#ifndef SQLITEDB_H
#define SQLITEDB_H

#include <stdlib.h>
#include <qstringlist.h>
#include <qmap.h>
#include <qvaluelist.h>
#include <qobject.h>
#include "sqllogform.h"
#include "sqlite_source/sqlite3.h"
#include "sqlitebrowsertypes.h"
/*#include "sqlite_source/sqlxtra_util.h"
#include "sqlite_source/encode.h"
#include "sqlite_source/swap.h"*/

#define MAX_DISPLAY_LENGTH 256

enum
{
 kLogMsg_User,
 kLogMsg_App
};

static QString applicationName = QString("SQLite Database Browser");
static QString applicationIconName = QString("icone16.png");
static QString aboutText = QString("Version 1.3\n\nSQLite Database Browser is a 
freeware, public domain, open source visual tool used to create, design and 
edit database files compatible with SQLite 3.x.\n\nIt has been developed 
originally by Mauricio Piacentini from Tabuleiro Producoes. \n\nIn the spirit 
of the original SQLite source code, the author disclaims copyright to this 
source code.");


typedef QMap<int, class DBBrowserField> fieldMap;
typedef QMap<int, class DBBrowserTable> tableMap;
typedef QMap<int, class DBBrowserIndex> indexMap;
typedef QMap<int, int> rowIdMap;

typedef QValueList<QStringList> rowList;
typedef QMap<int, QString> resultMap;

//utility functions
/*
uint utf16len(const ushort* utf16);
QString StringFromUTF16(const void* utf16);*/

class DBBrowserField
    {    
    public:
        DBBrowserField() : name( 0 ) { }
        DBBrowserField( const QString& wname,const QString& wtype )
            : name( wname), type( wtype )
        { }
        QString getname() const { return name; }
        QString gettype() const { return type; }
 private:
        QString name;
        QString type;
 };

class DBBrowserIndex
    {    
    public:
        DBBrowserIndex() : name( 0 ) { }
       DBBrowserIndex( const QString& wname,const QString& wsql )
            : name( wname), sql( wsql )
        { }
        QString getname() const { return name; }
        QString getsql() const { return sql; }
private:
        QString name;
        QString sql;
 };


class DBBrowserTable
    {    
    public:
        DBBrowserTable() : name( 0 ) { }
        DBBrowserTable( const QString& wname,const QString& wsql )
            : name( wname), sql( wsql )
        { }

        void addField(int order, const QString& wfield,const QString& wtype);

        QString getname() const { return name; }
        QString getsql() const { return sql; }
        fieldMap fldmap;
private:
        QString name;
        QString sql;
 };


class DBBrowserDB
{
public:
 DBBrowserDB (): _db( 0 ) , hasValidBrowseSet(false) {}
 ~DBBrowserDB (){}
 bool open ( const QString & db);
 bool create ( const QString & db);
 void close ();
 bool compact ();
 bool setRestorePoint();
 bool save ();
 bool revert ();
 bool dump( const QString & filename);
 bool reload( const QString & filename, int * lineErr);
 bool executeSQL ( const QString & statement);
 bool executeSQLDirect ( const QString & statement);
 void updateSchema() ;
 bool addRecord();
 bool deleteRecord(int wrow);
 bool updateRecord(int wrow, int wcol, const QString & wtext);
 bool browseTable( const QString & tablename );
 QStringList getTableFields(const QString & tablename);
 QStringList getTableTypes(const QString & tablename);
 QStringList getTableNames();
 QStringList getIndexNames();
 resultMap getFindResults( const QString & wfield, const QString & woperator, 
const QString & wsearchterm);
 int getRecordCount();
 bool isOpen();
 void setDirty(bool dirtyval);
 void setDirtyDirect(bool dirtyval);
 bool getDirty();
 void logSQL(QString statement, int msgtype);
 sqlite3 * _db;


        QStringList decodeCSV(const QString & csvfilename, char sep, char 
quote,  int maxrecords, int * numfields);

        tableMap tbmap;
        indexMap idxmap;
        rowIdMap idmap;
        
        rowList browseRecs;
        QStringList browseFields;
        bool hasValidBrowseSet;
        QString curBrowseTableName;
        QString lastErrorMessage;
        QString curDBFilename;
        
        sqlLogForm * logWin;
        

        private:
            bool dirty;
        void getTableRecords( const QString & tablename );
        
        
};

#endif
\ No newline at end of file
+#ifndef SQLITEDB_H
#define SQLITEDB_H

#include <stdlib.h>
#include <qstringlist.h>
#include <qmap.h>
#include <qvaluelist.h>
#include <qobject.h>
#include "sqllogform.h"
#include <sqlite3.h>
#include "sqlitebrowsertypes.h"

#define MAX_DISPLAY_LENGTH 256

enum
{
 kLogMsg_User,
 kLogMsg_App
};

static QString applicationName = QString("SQLite Database Browser");
static QString applicationIconName = QString("icone16.png");
static QString aboutText = QString("Version 1.3\n\nSQLite Database Browser is a 
freeware, public domain, open source visual tool used to create, design and 
edit database files compatible with SQLite 3.x.\n\nIt has been developed 
originally by Mauricio Piacentini from Tabuleiro Producoes. \n\nIn the spirit 
of the original SQLite source code, the author disclaims copyright to this 
source code.");


typedef QMap<int, class DBBrowserField> fieldMap;
typedef QMap<int, class DBBrowserTable> tableMap;
typedef QMap<int, class DBBrowserIndex> indexMap;
typedef QMap<int, int> rowIdMap;

typedef QValueList<QStringList> rowList;
typedef QMap<int, QString> resultMap;

//utility functions
/*
uint utf16len(const ushort* utf16);
QString StringFromUTF16(const void* utf16);*/

class DBBrowserField
    {    
    public:
        DBBrowserField() : name( 0 ) { }
        DBBrowserField( const QString& wname,const QString& wtype )
            : name( wname), type( wtype )
        { }
        QString getname() const { return name; }
        QString gettype() const { return type; }
 private:
        QString name;
        QString type;
 };

class DBBrowserIndex
    {    
    public:
        DBBrowserIndex() : name( 0 ) { }
       DBBrowserIndex( const QString& wname,const QString& wsql )
            : name( wname), sql( wsql )
        { }
        QString getname() const { return name; }
        QString getsql() const { return sql; }
private:
        QString name;
        QString sql;
 };


class DBBrowserTable
    {    
    public:
        DBBrowserTable() : name( 0 ) { }
        DBBrowserTable( const QString& wname,const QString& wsql )
            : name( wname), sql( wsql )
        { }

        void addField(int order, const QString& wfield,const QString& wtype);

        QString getname() const { return name; }
        QString getsql() const { return sql; }
        fieldMap fldmap;
private:
        QString name;
        QString sql;
 };


class DBBrowserDB
{
public:
 DBBrowserDB (): _db( 0 ) , hasValidBrowseSet(false) {}
 ~DBBrowserDB (){}
 bool open ( const QString & db);
 bool create ( const QString & db);
 void close ();
 bool compact ();
 bool setRestorePoint();
 bool save ();
 bool revert ();
 bool dump( const QString & filename);
 bool reload( const QString & filename, int * lineErr);
 bool executeSQL ( const QString & statement);
 bool executeSQLDirect ( const QString & statement);
 void updateSchema() ;
 bool addRecord();
 bool deleteRecord(int wrow);
 bool updateRecord(int wrow, int wcol, const QString & wtext);
 bool browseTable( const QString & tablename );
 QStringList getTableFields(const QString & tablename);
 QStringList getTableTypes(const QString & tablename);
 QStringList getTableNames();
 QStringList getIndexNames();
 resultMap getFindResults( const QString & wfield, const QString & woperator, 
const QString & wsearchterm);
 int getRecordCount();
 bool isOpen();
 void setDirty(bool dirtyval);
 void setDirtyDirect(bool dirtyval);
 bool getDirty();
 void logSQL(QString statement, int msgtype);
 sqlite3 * _db;


        QStringList decodeCSV(const QString & csvfilename, char sep, char 
quote,  int maxrecords, int * numfields);

        tableMap tbmap;
        indexMap idxmap;
        rowIdMap idmap;
        
        rowList browseRecs;
        QStringList browseFields;
        bool hasValidBrowseSet;
        QString curBrowseTableName;
        QString lastErrorMessage;
        QString curDBFilename;
        
        sqlLogForm * logWin;
        

        private:
            bool dirty;
        void getTableRecords( const QString & tablename );
        
        
};

#endif
only in patch2:
unchanged:
--- sqlitebrowser-1.3.orig/sqlitebrowser/sqlbrowser_util.h
+++ sqlitebrowser-1.3/sqlitebrowser/sqlbrowser_util.h
@@ -6,7 +6,7 @@
 #endif
 
 #include <ctype.h>
-#include "sqlite_source/sqlite3.h"
+#include <sqlite3.h>
 #include <stdio.h>
 
 
only in patch2:
unchanged:
--- sqlitebrowser-1.3.orig/sqlitebrowser/sqlbrowser_util.c
+++ sqlitebrowser-1.3/sqlitebrowser/sqlbrowser_util.c
@@ -1,10 +1,48 @@
 #include "sqlbrowser_util.h"
-#include "sqlite_source/sqlite3.h"
+#include <sqlite3.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
+
+
+// THIS IS RIPPED FROM sqlite3 util.c
+
+/*
+** Return TRUE if z is a pure numeric string.  Return FALSE if the
+** string contains any character which is not part of a number. If
+** the string is numeric and contains the '.' character, set *realnum
+** to TRUE (otherwise FALSE).
+**
+** An empty string is considered non-numeric.
+*/
+int sqlite3IsNumber(const char *z, int *realnum, __uint8_t enc){
+  int incr = (enc==SQLITE_UTF8?1:2);
+  if( enc==SQLITE_UTF16BE ) z++;
+  if( *z=='-' || *z=='+' ) z += incr;
+  if( !isdigit(*(__uint8_t*)z) ){
+    return 0;
+  }
+  z += incr;
+  if( realnum ) *realnum = 0;
+  while( isdigit(*(__uint8_t*)z) ){ z += incr; }
+  if( *z=='.' ){
+    z += incr;
+    if( !isdigit(*(__uint8_t*)z) ) return 0;
+    while( isdigit(*(__uint8_t*)z) ){ z += incr; }
+    if( realnum ) *realnum = 1;
+  }
+  if( *z=='e' || *z=='E' ){
+    z += incr;
+    if( *z=='+' || *z=='-' ) z += incr;
+    if( !isdigit(*(__uint8_t*)z) ) return 0;
+    while( isdigit(*(__uint8_t*)z) ){ z += incr; }
+    if( realnum ) *realnum = 1;
+  }
+  return *z==0;
+}
+
 
-#include "sqlite_source/sqliteInt.h"
 
 /*following routines extracted from shell.c for dump support*/
 
@@ -351,7 +389,7 @@
 static int _is_command_terminator(const char *zLine){
   while( isspace(*zLine) ){ zLine++; };
   if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1;  /* Oracle */
-  if( sqlite3StrNICmp(zLine,"go",2)==0 && _all_whitespace(&zLine[2]) ){
+  if( strncasecmp(zLine,"go",2)==0 && _all_whitespace(&zLine[2]) ){
     return 1;  /* SQL Server */
   }
   return 0;



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to