gnucash-on-windows master: Bug 797252 - missing /opensp-1.5.2.patch file required in...
John Ralls
jralls at code.gnucash.org
Sat May 25 13:14:59 EDT 2019
Updated via https://github.com/Gnucash/gnucash-on-windows/commit/4199156c (commit)
from https://github.com/Gnucash/gnucash-on-windows/commit/c68c63a5 (commit)
commit 4199156cc51d66ae31a4749be718d469dcd25b29
Author: John Ralls <jralls at ceridwen.us>
Date: Sat May 25 10:13:51 2019 -0700
Bug 797252 - missing /opensp-1.5.2.patch file required in...
/gnucash.modules for Windows gnucash.
Plus two libdbi patches, inadvertently removed while cleaning
out the old buildsystem.
diff --git a/gnucash.modules b/gnucash.modules
index 1130ae6..378aa68 100644
--- a/gnucash.modules
+++ b/gnucash.modules
@@ -207,7 +207,7 @@
autogen-template='/bin/bash -c "pushd %(srcdir)s && ./autoinit.sh && popd && %(srcdir)s/configure --prefix %(prefix)s %(autogenargs)s"'>
<branch repo="sourceforge" module="openjade/OpenSP-1.5.2.tar.gz"
version='1.5.2'>
- <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/opensp-1.5.2.patch" strip='1'/>
+ <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/patches/opensp-1.5.2.patch" strip='1'/>
<patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/patches/OpenSP-1.5.2-non-posix-functions.patch" strip='1'/>
</branch>
</autotools>
@@ -247,7 +247,7 @@
<autotools id="libdbi" autogen-sh="autoreconf" autogenargs="--disable-docs">
<branch repo="sourceforge" module="libdbi/libdbi-0.8.4.tar.gz"
version="0.8.4">
- <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/libdbi-0.8.3.patch" strip="1"/>
+ <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/patches/libdbi-0.8.3.patch" strip="1"/>
</branch>
</autotools>
@@ -255,7 +255,7 @@
autogenargs='--disable-docs --with-sqlite3 --with-sqlite3-dir="/mingw32" --with-pgsql --with-pgsql-dir="/mingw32" --with-mysql --with-mysql-dir="/mingw32" '>
<branch repo="sourceforge" version="0.8.3"
module="libdbi-drivers/libdbi-drivers-0.8.3-1.tar.gz">
- <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/libdbi-drivers-errno.patch" strip="1"/>
+ <patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/patches/patches/libdbi-drivers-errno.patch" strip="1"/>
<patch file="https://raw.githubusercontent.com/Gnucash/gnucash-on-windows/master/patches/libdbi-drivers-linkage.patch" strip="1"/>
</branch>
<dependencies>
diff --git a/patches/libdbi-0.8.3.patch b/patches/libdbi-0.8.3.patch
new file mode 100644
index 0000000..5291902
--- /dev/null
+++ b/patches/libdbi-0.8.3.patch
@@ -0,0 +1,61 @@
+diff -Nur libdbi-0.8.3-old/include/dbi/dbd.h libdbi-0.8.3/include/dbi/dbd.h
+--- libdbi-0.8.3-old/include/dbi/dbd.h 2005-08-15 21:18:18.000000000 +0200
++++ libdbi-0.8.3/include/dbi/dbd.h 2008-10-05 15:57:24.889982668 +0200
+@@ -52,7 +52,7 @@
+ size_t dbd_quote_binary(dbi_conn_t *conn, const unsigned char *orig, size_t from_length, unsigned char **ptr_dest);
+ size_t dbd_conn_quote_string(dbi_conn_t *conn, const char *orig, char *dest);
+ const char *dbd_select_db(dbi_conn_t *conn, const char *db);
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr);
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr);
+ unsigned long long dbd_get_seq_last(dbi_conn_t *conn, const char *sequence);
+ unsigned long long dbd_get_seq_next(dbi_conn_t *conn, const char *sequence);
+ int dbd_ping(dbi_conn_t *conn);
+@@ -63,7 +63,7 @@
+ void _dbd_result_add_field(dbi_result_t *result, unsigned int fieldidx, char *name, unsigned short type, unsigned int attribs);
+ dbi_row_t *_dbd_row_allocate(unsigned int numfields);
+ void _dbd_row_finalize(dbi_result_t *result, dbi_row_t *row, unsigned long long rowidx);
+-void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int errno);
++void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int err_no);
+ dbi_result_t *_dbd_result_create_from_stringarray(dbi_conn_t *conn, unsigned long long numrows_matched, const char **stringarray);
+ void _dbd_register_driver_cap(dbi_driver_t *driver, const char *capname, int value);
+ void _dbd_register_conn_cap(dbi_conn_t *conn, const char *capname, int value);
+--- libdbi-0.8.3/src/dbd_helper.c.orig Sun Sep 13 16:34:39 2009
++++ libdbi-0.8.3/src/dbd_helper.c Sun Sep 13 16:35:02 2009
+@@ -145,7 +145,7 @@
+ return len;
+ }
+
+-void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int errno) {
++void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int err_no) {
+ int my_errno = DBI_ERROR_NONE;
+ int errstatus;
+ char *my_errmsg = NULL;
+@@ -154,7 +154,7 @@
+ free(conn->error_message);
+ }
+
+- if (errno == DBI_ERROR_DBD) {
++ if (err_no == DBI_ERROR_DBD) {
+ /* translate into a client-library specific error number */
+ errstatus = conn->driver->functions->geterror(conn, &my_errno, &my_errmsg);
+
+@@ -171,8 +171,8 @@
+ }
+ }
+ else if (errmsg) {
+- conn->error_flag = errno; /* legacy code may rely on this */
+- conn->error_number = errno;
++ conn->error_flag = err_no; /* legacy code may rely on this */
++ conn->error_number = err_no;
+ conn->error_message = strdup(errmsg);
+
+ if (conn->error_handler != NULL) {
+@@ -181,7 +181,7 @@
+ }
+ else {
+ /* pass internal errors to the internal libdbi handler */
+- _error_handler(conn, errno);
++ _error_handler(conn, err_no);
+ }
+
+ }
diff --git a/patches/libdbi-drivers-errno.patch b/patches/libdbi-drivers-errno.patch
new file mode 100644
index 0000000..9de25a5
--- /dev/null
+++ b/patches/libdbi-drivers-errno.patch
@@ -0,0 +1,167 @@
+diff --git a/drivers/firebird/dbd_firebird.c b/drivers/firebird/dbd_firebird.c
+index 4a1f30d..035479e 100755
+--- a/drivers/firebird/dbd_firebird.c
++++ b/drivers/firebird/dbd_firebird.c
+@@ -524,10 +524,10 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db)
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr)
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr)
+ {
+ /* error_message and error_number were already set by calls to _dbd_internal_error_handler */
+- *errno = conn->error_number;
++ *err_no = conn->error_number;
+ *errstr = (conn->error_message) ? strdup(conn->error_message):NULL;
+ return 1;
+ }
+diff --git a/drivers/freetds/dbd_freetds.c b/drivers/freetds/dbd_freetds.c
+index 2a24764..9f57d85 100644
+--- a/drivers/freetds/dbd_freetds.c
++++ b/drivers/freetds/dbd_freetds.c
+@@ -733,10 +733,10 @@ const char *dbd_select_db(dbi_conn_t * conn, const char *db)
+ return (char *) db;
+ }
+
+-int dbd_geterror(dbi_conn_t * conn, int *errno, char **errstr)
++int dbd_geterror(dbi_conn_t * conn, int *err_no, char **errstr)
+ {
+ /* put error number into errno, error string into errstr
+- * return 0 if error, 1 if errno filled, 2 if errstr filled, 3 if both errno and errstr filled */
++ * return 0 if error, 1 if err_no filled, 2 if errstr filled, 3 if both err_no and errstr filled */
+
+ /* We havn't functions for read error types in freetds */
+ return -1;
+diff --git a/drivers/msql/dbd_msql.c b/drivers/msql/dbd_msql.c
+index bdf270e..cef20a8 100644
+--- a/drivers/msql/dbd_msql.c
++++ b/drivers/msql/dbd_msql.c
+@@ -277,12 +277,12 @@
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr)
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr)
+ {
+ if(!msqlErrMsg)
+ return -1;
+
+- *errno = 0;
++ *err_no = 0;
+ *errstr = strdup(msqlErrMsg);
+ return 2;
+ }
+diff --git a/drivers/mysql/dbd_mysql.c b/drivers/mysql/dbd_mysql.c
+index 7d06f62..237506c 100644
+--- a/drivers/mysql/dbd_mysql.c
++++ b/drivers/mysql/dbd_mysql.c
+@@ -553,15 +553,15 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db) {
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr) {
+- /* put error number into errno, error string into errstr
+- * return 0 if error, 1 if errno filled, 2 if errstr filled, 3 if both errno and errstr filled */
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr) {
++ /* put error number into err_no, error string into errstr
++ * return 0 if error, 1 if err_no filled, 2 if errstr filled, 3 if both err_no and errstr filled */
+
+ if (strcmp("",mysql_error((MYSQL *)conn->connection)) == 0) {
+ return -1;
+ }
+
+- *errno = mysql_errno((MYSQL *)conn->connection);
++ *err_no = mysql_errno((MYSQL *)conn->connection);
+ *errstr = strdup(mysql_error((MYSQL *)conn->connection));
+ return 3;
+ }
+diff --git a/drivers/oracle/dbd_oracle.c b/drivers/oracle/dbd_oracle.c
+index 1f38094..d220a9e 100755
+--- a/drivers/oracle/dbd_oracle.c
++++ b/drivers/oracle/dbd_oracle.c
+@@ -400,12 +400,12 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db)
+ return NULL; /* Oracle can't do that .... */
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr)
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr)
+ {
+ char errbuf[1024];
+ int errcode = 0;
+ Oraconn *Oconn = conn->connection;
+- *errno = 0;
++ *err_no = 0;
+
+ if (!conn->connection) {
+ *errstr = strdup("Unable to connect to database.");
+@@ -414,7 +414,7 @@ int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr)
+ OCIErrorGet((dvoid *)Oconn->err, (ub4) 1, (text *) NULL, &errcode, errbuf,
+ (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
+ *errstr = strdup(errbuf);
+- *errno = errcode;
++ *err_no = errcode;
+ }
+
+ return 3;
+diff --git a/drivers/pgsql/dbd_pgsql.c b/drivers/pgsql/dbd_pgsql.c
+index 0433550..c097dac 100644
+--- a/drivers/pgsql/dbd_pgsql.c
++++ b/drivers/pgsql/dbd_pgsql.c
+@@ -520,11 +520,11 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db) {
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr) {
+- /* put error number into errno, error string into errstr
+- * return 0 if error, 1 if errno filled, 2 if errstr filled, 3 if both errno and errstr filled */
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr) {
++ /* put error number into err_no, error string into errstr
++ * return 0 if error, 1 if err_no filled, 2 if errstr filled, 3 if both err_no and errstr filled */
+
+- *errno = 0;
++ *err_no = 0;
+ *errstr = strdup(PQerrorMessage((PGconn *)conn->connection));
+
+ return 2;
+diff --git a/drivers/sqlite/dbd_sqlite.c b/drivers/sqlite/dbd_sqlite.c
+index 94dacc0..aeadfa5 100644
+--- a/drivers/sqlite/dbd_sqlite.c
++++ b/drivers/sqlite/dbd_sqlite.c
+@@ -911,13 +911,13 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db) {
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr) {
+- /* put error number into errno, error string into errstr
+- * return 0 if error, 1 if errno filled, 2 if errstr filled, 3 if both errno and errstr filled */
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr) {
++ /* put error number into err_no, error string into errstr
++ * return 0 if error, 1 if err_no filled, 2 if errstr filled, 3 if both err_no and errstr filled */
+ int result = 0;
+
+ if (conn->error_number) {
+- *errno = conn->error_number;
++ *err_no = conn->error_number;
+ result++;
+ }
+ if (conn->error_message) {
+diff --git a/drivers/sqlite3/dbd_sqlite3.c b/drivers/sqlite3/dbd_sqlite3.c
+index dc85465..3360c27 100644
+--- a/drivers/sqlite3/dbd_sqlite3.c
++++ b/drivers/sqlite3/dbd_sqlite3.c
+@@ -880,11 +880,11 @@ const char *dbd_select_db(dbi_conn_t *conn, const char *db) {
+ return db;
+ }
+
+-int dbd_geterror(dbi_conn_t *conn, int *errno, char **errstr) {
+- /* put error number into errno, error string into errstr
+- * return 0 if error, 1 if errno filled, 2 if errstr filled, 3 if both errno and errstr filled */
++int dbd_geterror(dbi_conn_t *conn, int *err_no, char **errstr) {
++ /* put error number into err_no, error string into errstr
++ * return 0 if error, 1 if err_no filled, 2 if errstr filled, 3 if both err_no and errstr filled */
+
+- *errno = sqlite3_errcode((sqlite3 *)conn->connection);
++ *err_no = sqlite3_errcode((sqlite3 *)conn->connection);
+ *errstr = strdup((char*)sqlite3_errmsg((sqlite3 *)conn->connection));
+ return 3;
+ }
diff --git a/patches/opensp-1.5.2.patch b/patches/opensp-1.5.2.patch
new file mode 100644
index 0000000..3271365
--- /dev/null
+++ b/patches/opensp-1.5.2.patch
@@ -0,0 +1,40 @@
+--- a/lib/Makefile.am Thu Dec 15 13:13:16 2005
++++ b/lib/Makefile.am Tue Feb 6 10:57:58 2007
+@@ -76,7 +76,9 @@
+ splibpch.h token.h app_inst.cxx arc_inst.cxx entmgr_inst.cxx \
+ parser_inst.cxx xentmgr_inst.cxx SubstTable.cxx \
+ UTF16CodingSystem.cxx Fixed4CodingSystem.cxx \
+- memcmp.c memmove.c strerror.c
++ memcmp.c memmove.c strerror.c WinInetStorage.cxx \
++ WinInetStorageMessages.h WinInetStorageMessages.msg \
++ WinInetStorageMessages.rc WinApp.cxx Win32CodingSystem.cxx
+
+ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/generic
+
+--- a/lib/MessageReporter.cxx 2005-07-21 07:05:17.000000000 -0700
++++ b/lib/MessageReporter.cxx 2017-05-06 11:51:04.348011200 -0700
+@@ -13,7 +13,8 @@
+ #include "macros.h"
+
+ #include <string.h>
+-
++#include <iostream>
++#include <sstream>
+
+ #ifdef SP_NAMESPACE
+ namespace SP_NAMESPACE {
+@@ -123,8 +124,12 @@
+ os() << ':';
+ }
+ if (options_ & messageNumbers)
+- os() << (unsigned long)message.type->module() << "."
++ {
++ std::ostringstream ss;
++ ss << (void*)message.type->module();
++ os() << ss.str().c_str() << "."
+ << (unsigned long)message.type->number() << ":";
++ }
+ switch (message.type->severity()) {
+ case MessageType::info:
+ formatFragment(MessageReporterMessages::infoTag, os());
+
Summary of changes:
gnucash.modules | 6 +-
patches/libdbi-0.8.3.patch | 61 ++++++++++++++
patches/libdbi-drivers-errno.patch | 167 +++++++++++++++++++++++++++++++++++++
patches/opensp-1.5.2.patch | 40 +++++++++
4 files changed, 271 insertions(+), 3 deletions(-)
create mode 100644 patches/libdbi-0.8.3.patch
create mode 100644 patches/libdbi-drivers-errno.patch
create mode 100644 patches/opensp-1.5.2.patch
More information about the gnucash-changes
mailing list