diff options
author | tsarna <tsarna> | 2004-10-05 19:49:28 +0000 |
---|---|---|
committer | tsarna <tsarna> | 2004-10-05 19:49:28 +0000 |
commit | 065b894dfd0f60c649d0de5c9f25e0ec78e6595d (patch) | |
tree | d34016799b31eb3353a2484292fb016b98267501 | |
parent | 51870f43c7a4fb31d3171db5150ed438f5843c41 (diff) | |
download | pkgsrc-065b894dfd0f60c649d0de5c9f25e0ec78e6595d.tar.gz |
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.
-rw-r--r-- | databases/py-sybase/Makefile | 4 | ||||
-rw-r--r-- | databases/py-sybase/distinfo | 3 | ||||
-rw-r--r-- | databases/py-sybase/patches/patch-aa | 53 |
3 files changed, 57 insertions, 3 deletions
diff --git a/databases/py-sybase/Makefile b/databases/py-sybase/Makefile index 2b2a3f2e1cb..bc6a281da86 100644 --- a/databases/py-sybase/Makefile +++ b/databases/py-sybase/Makefile @@ -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 --git a/databases/py-sybase/distinfo b/databases/py-sybase/distinfo index d51d7d80194..b791c9738d4 100644 --- a/databases/py-sybase/distinfo +++ b/databases/py-sybase/distinfo @@ -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 --git a/databases/py-sybase/patches/patch-aa b/databases/py-sybase/patches/patch-aa new file mode 100644 index 00000000000..2b0d3ece34f --- /dev/null +++ b/databases/py-sybase/patches/patch-aa @@ -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() |