From e7a4d92e6a215395829830816983e2f05978b75d Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 9 Aug 2004 04:33:27 +0000 Subject: cleaned up ebuild and patch --- dev-tcltk/tcl-sql/ChangeLog | 6 +++- dev-tcltk/tcl-sql/files/fix-const.patch | 58 +++++++++++++++++++++++++++---- dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild | 15 ++++---- 3 files changed, 64 insertions(+), 15 deletions(-) (limited to 'dev-tcltk/tcl-sql') diff --git a/dev-tcltk/tcl-sql/ChangeLog b/dev-tcltk/tcl-sql/ChangeLog index 929a7a5105fe..96510450809e 100644 --- a/dev-tcltk/tcl-sql/ChangeLog +++ b/dev-tcltk/tcl-sql/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-tcltk/tcl-sql # Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tcl-sql/ChangeLog,v 1.1 2004/08/08 15:10:00 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tcl-sql/ChangeLog,v 1.2 2004/08/09 04:33:27 cardoe Exp $ + + 09 Aug 2004; Doug Goldstein files/fix-const.patch, + tcl-sql-20000114.ebuild: + Cleaner patch and cleaned up ebuild 07 Aug 2004; Doug Goldstein tcl-sql-20000114.ebuild: Initial addition to portage diff --git a/dev-tcltk/tcl-sql/files/fix-const.patch b/dev-tcltk/tcl-sql/files/fix-const.patch index d5dcf9024acb..64289472265a 100644 --- a/dev-tcltk/tcl-sql/files/fix-const.patch +++ b/dev-tcltk/tcl-sql/files/fix-const.patch @@ -1,6 +1,51 @@ ---- sql.cc.bak 2004-08-08 14:46:45.967588496 +0800 -+++ sql.cc 2004-08-08 14:51:06.629961792 +0800 -@@ -122,7 +122,7 @@ int fetchrowCmd(Tcl_Interp *interp, Sql_ +diff -urN tcl-sql.old/sql-mysql.cc tcl-sql/sql-mysql.cc +--- tcl-sql.old/sql-mysql.cc 2000-01-12 20:50:03.000000000 -0500 ++++ tcl-sql/sql-mysql.cc 2004-08-08 13:15:15.820828056 -0400 +@@ -1,3 +1,4 @@ ++#define USE_OLD_FUNCTIONS + #include "tcl.h" + #include "sql-mysql.h" + +@@ -20,7 +21,7 @@ + // ------------------------------------------------------------- + char * + Sql_mysql::getErrorMsg() { +- char *msg = mysql_error(&mysql); ++ char *msg = (char *)mysql_error(&mysql); + if (*msg == '\0') { + return errormsg; + } else { +@@ -71,7 +72,7 @@ + + // ------------------------------------------------------------- + int +-Sql_mysql::numRows(int resHandle=0) { ++Sql_mysql::numRows(int resHandle) { + if (!results[resHandle]) { return -1; } + return(mysql_num_rows(results[resHandle])); + } +@@ -109,7 +110,7 @@ + + // ------------------------------------------------------------- + void +-Sql_mysql::endquery(int resHandle=0) { ++Sql_mysql::endquery(int resHandle) { + if (!results[resHandle]) return; + mysql_free_result(results[resHandle]); + results[resHandle] = NULL; +@@ -120,7 +121,7 @@ + // Note: A new Sql_row is allocated. Has to be freed by calling + // party. + Sql_row * +-Sql_mysql::fetchrow(int resHandle=0) { ++Sql_mysql::fetchrow(int resHandle) { + + if (!results[resHandle]) { + sprintf(errormsg, "Result handle [%d] not in use.\n", resHandle); +diff -urN tcl-sql.old/sql.cc tcl-sql/sql.cc +--- tcl-sql.old/sql.cc 2000-01-12 20:53:23.000000000 -0500 ++++ tcl-sql/sql.cc 2004-08-08 13:12:57.058923072 -0400 +@@ -122,7 +122,7 @@ // ------------------------------------------------------------- // @@ -9,7 +54,7 @@ { if (argc == 1) { Tcl_SetResult(interp, "Usage: sql command ?handle?", TCL_STATIC); -@@ -137,7 +137,7 @@ int SqlCmd(ClientData clientData, Tcl_In +@@ -137,7 +137,7 @@ // ----------------------------------- if (strcmp(argv[1], "connect")==0) { @@ -18,7 +63,7 @@ if (c < 0) { char *basemsg = "Unable to Connect: "; char *errmsg = mgr->getErrorMsg(); -@@ -160,7 +160,7 @@ int SqlCmd(ClientData clientData, Tcl_In +@@ -160,7 +160,7 @@ if (argc <= 2) { Tcl_SetResult(interp, "Usage:\nsql command handle", TCL_STATIC); return TCL_ERROR; @@ -27,7 +72,7 @@ Tcl_AppendResult(interp, "sql: Invalid handle: ", argv[2], NULL); return TCL_ERROR; } else if (!mgr->inUse(connid)) { -@@ -172,19 +172,19 @@ int SqlCmd(ClientData clientData, Tcl_In +@@ -172,19 +172,19 @@ // take care of the command: if (strcmp(argv[1], "exec") == 0) { @@ -53,3 +98,4 @@ } else { Tcl_AppendResult(interp, "sql: unknown sql command: ", argv[1], NULL); return TCL_ERROR; + diff --git a/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild b/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild index 8e8819386bb0..f3cc658c8e0d 100644 --- a/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild +++ b/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild,v 1.1 2004/08/08 15:10:00 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tcl-sql/tcl-sql-20000114.ebuild,v 1.2 2004/08/09 04:33:27 cardoe Exp $ inherit eutils @@ -17,16 +17,15 @@ DEPEND="dev-lang/tcl S=${WORKDIR}/${PN} -src_compile() { - chmod +w sql-mysql.cc +src_unpack() { + unpack ${A} + cd ${S} + chmod +w sql-mysql.cc epatch ${FILESDIR}/fix-const.patch +} - sed -i -e 's|(int resHandle=0)|(int resHandle)|g' sql-mysql.cc || die "sed failed" - sed -i -e 's|char \*msg = mysql_error|char \*msg = (char *)mysql_error|' sql-mysql.cc || die "sed failed" - echo '#define USE_OLD_FUNCTIONS' > sql-mysql.cc.temp - cat sql-mysql.cc >> sql-mysql.cc.temp - mv sql-mysql.cc.temp sql-mysql.cc +src_compile() { emake || die } -- cgit v1.2.3-65-gdbad