pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/databases/py-sybase Add a patch by me, also fed back:
details: https://anonhg.NetBSD.org/pkgsrc/rev/f0cdd068ffd0
branches: trunk
changeset: 481488:f0cdd068ffd0
user: tsarna <tsarna%pkgsrc.org@localhost>
date: Tue Oct 05 19:49:28 2004 +0000
description:
Add a patch by me, also fed back:
Treat more informational messages as non-fatal, and add an
extension to allow an application to capture them.
Also bump revision.
diffstat:
databases/py-sybase/Makefile | 4 +-
databases/py-sybase/distinfo | 3 +-
databases/py-sybase/patches/patch-aa | 53 ++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 3 deletions(-)
diffs (82 lines):
diff -r 827910fa3ff2 -r f0cdd068ffd0 databases/py-sybase/Makefile
--- a/databases/py-sybase/Makefile Tue Oct 05 19:00:57 2004 +0000
+++ b/databases/py-sybase/Makefile Tue Oct 05 19:49:28 2004 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.6 2004/10/03 00:13:23 tv Exp $
+# $NetBSD: Makefile,v 1.7 2004/10/05 19:49:28 tsarna Exp $
#
DISTNAME= sybase-0.36
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= databases python
MASTER_SITES= http://object-craft.com.au/projects/sybase/download/
diff -r 827910fa3ff2 -r f0cdd068ffd0 databases/py-sybase/distinfo
--- a/databases/py-sybase/distinfo Tue Oct 05 19:00:57 2004 +0000
+++ b/databases/py-sybase/distinfo Tue Oct 05 19:49:28 2004 +0000
@@ -1,4 +1,5 @@
-$NetBSD: distinfo,v 1.1.1.1 2003/07/25 11:31:15 drochner Exp $
+$NetBSD: distinfo,v 1.2 2004/10/05 19:49:28 tsarna Exp $
SHA1 (sybase-0.36.tar.gz) = 9b46e9e0dfb222cd36101208d3dcb9190f15b6aa
Size (sybase-0.36.tar.gz) = 93919 bytes
+SHA1 (patch-aa) = 9cc66a802e7b21fa7f2d1cc410902089f80a0831
diff -r 827910fa3ff2 -r f0cdd068ffd0 databases/py-sybase/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/py-sybase/patches/patch-aa Tue Oct 05 19:49:28 2004 +0000
@@ -0,0 +1,53 @@
+$NetBSD: patch-aa,v 1.1 2004/10/05 19:49:28 tsarna Exp $
+
+Treat more informational messages as non-fatal, and add an
+extension to allow an application to capture them.
+
+--- Sybase.py.orig 2003-04-27 06:54:35.000000000 -0400
++++ Sybase.py 2004-10-05 15:01:02.000000000 -0400
+@@ -129,6 +129,8 @@
+ def Binary(str):
+ return str
+
++_output_hooks = {}
++
+ def _fmt_server(msg):
+ parts = []
+ for label, name in (('Msg', 'msgnumber'),
+@@ -157,8 +159,17 @@
+ raise DatabaseError(_fmt_client(msg))
+
+ def _servermsg_cb(ctx, conn, msg):
+- if msg.msgnumber not in (5701, 5703):
+- raise DatabaseError(_fmt_server(msg))
++ mn = msg.msgnumber
++ if mn in (0, 5701, 5703, 5704) or ((mn >= 6200) and (mn < 6300)):
++ # Non-errors:
++ # 0 PRINT
++ # 5701 Changed db context
++ # 5703 Changed language
++ # 5704 Changed character set (Sybase)
++ # 6200-6299 SHOWPLAN output (Sybase)
++ _output_hooks.get(conn, lambda c,m: None)(conn, msg)
++ else:
++ raise DatabaseError(_fmt_server(msg.text))
+
+ def _row_bind(cmd, count = 1):
+ '''Bind buffers for count rows of column data.
+@@ -838,6 +849,16 @@
+ finally:
+ self._unlock()
+
++ def set_output_hook(self, hook):
++ if hook is None:
++ if _output_hooks.has_key(self._conn):
++ del _output_hooks[self._conn]
++ else:
++ _output_hooks[self._conn] = hook
++
++ def get_output_hook(self, hook):
++ return _output_hooks.get(self._conn)
++
+ def __del__(self):
+ try:
+ self.close()
Home |
Main Index |
Thread Index |
Old Index