aboutsummaryrefslogtreecommitdiffstats
path: root/databases/tcl-Mysql
diff options
context:
space:
mode:
authormi <mi@FreeBSD.org>2004-11-12 02:06:27 +0800
committermi <mi@FreeBSD.org>2004-11-12 02:06:27 +0800
commit03323c0dee1fb75a30885e8acc68b58e359f9b2a (patch)
tree82dcfe4df7a93be168ec28319d010071d27bf754 /databases/tcl-Mysql
parentb8a33c3de1e01a53f266eaba7f2248f41d1f94f1 (diff)
downloadfreebsd-ports-gnome-03323c0dee1fb75a30885e8acc68b58e359f9b2a.tar.gz
freebsd-ports-gnome-03323c0dee1fb75a30885e8acc68b58e359f9b2a.tar.zst
freebsd-ports-gnome-03323c0dee1fb75a30885e8acc68b58e359f9b2a.zip
Make buildable with newer MySQL clients -- 4 and 5 -- but keep
compatible with the 3 -- mysql_error now returns `const char *', and there is no mysql_connect any more. Default to MySQL-4.x for now. Bump PORTREVISION. Reported by: Robert Andrews
Diffstat (limited to 'databases/tcl-Mysql')
-rw-r--r--databases/tcl-Mysql/Makefile4
-rw-r--r--databases/tcl-Mysql/files/Makefile.bsd2
-rw-r--r--databases/tcl-Mysql/files/patch-aa14
-rw-r--r--databases/tcl-Mysql/files/patch-redundant-defaults12
4 files changed, 23 insertions, 9 deletions
diff --git a/databases/tcl-Mysql/Makefile b/databases/tcl-Mysql/Makefile
index f22421cfdef5..4de968f7741b 100644
--- a/databases/tcl-Mysql/Makefile
+++ b/databases/tcl-Mysql/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ${TCL_NODOT}-sql
PORTVERSION= 20000114
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= databases ${TCL_NODOT}
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= tcl-sql
@@ -17,7 +17,7 @@ EXTRACT_SUFX= .tgz
MAINTAINER= mi@aldan.algebra.com
COMMENT= TCL module for accessing MySQL databases
-LIB_DEPENDS= mysqlclient:${PORTSDIR}/databases/mysql323-client
+LIB_DEPENDS= mysqlclient:${PORTSDIR}/databases/mysql41-client
BUILD_DEPENDS= tclsh${TCL_VERSION}:${PORTSDIR}/lang/${TCL_NODOT}
TCL_VERSION?= 8.4 # Only this needs changing to switch TCL-version
diff --git a/databases/tcl-Mysql/files/Makefile.bsd b/databases/tcl-Mysql/files/Makefile.bsd
index fc8baabbf05e..b8f4f14b1cf9 100644
--- a/databases/tcl-Mysql/files/Makefile.bsd
+++ b/databases/tcl-Mysql/files/Makefile.bsd
@@ -1,4 +1,4 @@
-TCL_VERSION?= tcl8.3
+TCL_VERSION?= tcl8.4
TCL_NODOT?= ${TCL_VERSION:S/.//}
SHLIB_NAME?= libTclMySQL.so.1
diff --git a/databases/tcl-Mysql/files/patch-aa b/databases/tcl-Mysql/files/patch-aa
index 47e2c1b63abf..06ab82f8afb3 100644
--- a/databases/tcl-Mysql/files/patch-aa
+++ b/databases/tcl-Mysql/files/patch-aa
@@ -5,8 +5,12 @@ be slightly different. The patch gets rid of a lot of sprintf and will
make your scripts faster, especially when fetching multiple rows of the
same queries.
+In modern MySQL mysql_error() returns a const-pointer, so getErrorMsg()
+had to be changed. However, since we are using TCL_STATIC anyway, we can
+just cast its result back down to plain char*
+
--- sql.cc Fri Aug 13 15:28:56 1999
-+++ sql.cc Thu Apr 1 17:04:56 2004
++++ sql.cc Wed Nov 10 17:40:19 2004
@@ -12,24 +12,11 @@
-const char* HANDLE_PREFIX = "sql";
@@ -41,12 +45,12 @@ same queries.
@@ -38,3 +25,3 @@
// An error occured.
- Tcl_SetResult(interp, conn->getErrorMsg(), TCL_VOLATILE);
-+ Tcl_SetResult(interp, conn->getErrorMsg(), TCL_STATIC);
++ Tcl_SetResult(interp, (char *)conn->getErrorMsg(), TCL_STATIC);
return TCL_ERROR;
@@ -47,3 +34,3 @@
// An error occured.
- Tcl_SetResult(interp, conn->getErrorMsg(), TCL_VOLATILE);
-+ Tcl_SetResult(interp, conn->getErrorMsg(), TCL_STATIC);
++ Tcl_SetResult(interp, (char *)conn->getErrorMsg(), TCL_STATIC);
return TCL_ERROR;
@@ -60,9 +47,9 @@
int queryCmd(Tcl_Interp *interp, Sql_interface *conn, char *cmd) {
@@ -55,7 +59,7 @@ same queries.
if ((handle = conn->query(cmd)) < 0) {
// An error occured.
- Tcl_SetResult(interp, conn->getErrorMsg(), TCL_VOLATILE);
-+ Tcl_SetResult(interp, conn->getErrorMsg(), TCL_STATIC);
++ Tcl_SetResult(interp, (char *)conn->getErrorMsg(), TCL_STATIC);
return TCL_ERROR;
}
- sprintf(interp->result, "%s%d", RESULT_PREFIX, handle);
@@ -149,7 +153,7 @@ same queries.
+ }
+ connid = mgr->connect(objc-2, argv);
+ if (connid < 0) {
-+ Tcl_SetResult(interp, mgr->getErrorMsg(), TCL_STATIC);
++ Tcl_SetResult(interp, (char *)mgr->getErrorMsg(), TCL_STATIC);
return TCL_ERROR;
}
- char errormsg[16];
diff --git a/databases/tcl-Mysql/files/patch-redundant-defaults b/databases/tcl-Mysql/files/patch-redundant-defaults
index da2fe8ee145c..bbfc8699a661 100644
--- a/databases/tcl-Mysql/files/patch-redundant-defaults
+++ b/databases/tcl-Mysql/files/patch-redundant-defaults
@@ -1,5 +1,15 @@
--- sql-mysql.cc Wed Jan 12 20:50:03 2000
-+++ sql-mysql.cc Tue Nov 26 19:48:56 2002
++++ sql-mysql.cc Wed Nov 10 17:40:19 2004
+@@ -19,7 +19,7 @@
+
+ // -------------------------------------------------------------
+-char *
++const char *
+ Sql_mysql::getErrorMsg() {
+- char *msg = mysql_error(&mysql);
++ const char *msg = mysql_error(&mysql);
+ if (*msg == '\0') {
+ return errormsg;
@@ -72,5 +72,5 @@
// -------------------------------------------------------------
int