# ChangeLog for dev-haskell/hsql
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hsql/ChangeLog,v 1.6 2006/03/11 20:33:26 dcoutts Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hsql/ChangeLog,v 1.7 2006/03/11 21:31:06 dcoutts Exp $
+
+ 11 Mar 2006; Duncan Coutts <dcoutts@gentoo.org>
+ +files/hsql-1.7-sqltext-to-int.patch, hsql-1.7.ebuild:
+ Add a patch by Bjorn Bringert to fix a problem found in the sqlite3 backend.
+ See also bugs #98549 and #98551.
11 Mar 2006; Duncan Coutts <dcoutts@gentoo.org> hsql-1.7.ebuild:
Remove the backends from PDEPEND. Use a message in pkg_postinst instead.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 0f90345ddd2bc9e123a90e46a00b9e4c ChangeLog 922
-RMD160 4fdc31f052737f6a312557781e19ebb3871305dc ChangeLog 922
-SHA256 68b3a9e95e30271be4aae9f25e2521bf144dc591e8fd2e1dc4ec4ca20ca15739 ChangeLog 922
+MD5 638f370809271e42626c52853530709a ChangeLog 1144
+RMD160 7b90dc411f8f246a9e3a7aff59a760e44561c887 ChangeLog 1144
+SHA256 8de97a756eb952c93d9b21ab5421fe24e2c7631f1d2b0b8a5c03c6b2aeb22d04 ChangeLog 1144
MD5 8b88f3b8f094ddbdd05b6694b7543fc7 files/digest-hsql-1.7 223
RMD160 7d319609e94b9fd8a725bbb036d5f6ae37e818f6 files/digest-hsql-1.7 223
SHA256 68b6c539208dcf5c7056e412864a29dda67a3bea95995b53b80c981b76e3cedd files/digest-hsql-1.7 223
-MD5 19853965d81712068c4c6fbc31233e33 hsql-1.7.ebuild 785
-RMD160 ed39b68bf5f62bdb9d1e7872d419efb4561bf969 hsql-1.7.ebuild 785
-SHA256 961cfada6f0e29f5360ddef3484db3481229f5b68ff5d1320d3390125c414ac7 hsql-1.7.ebuild 785
+MD5 8d8cd22a297e6d46e9722463ea64770c files/hsql-1.7-sqltext-to-int.patch 2443
+RMD160 2c81d50e1eb4cbf947d09ccdd9ed394374312b80 files/hsql-1.7-sqltext-to-int.patch 2443
+SHA256 abecdec2d2b86d55899520cce95249634232134f2045ef1fe1151884e433f20a files/hsql-1.7-sqltext-to-int.patch 2443
+MD5 4960102f87474509832aee715ba11cc6 hsql-1.7.ebuild 883
+RMD160 246c7315532c259780ba05bc3a5de36bf44f9293 hsql-1.7.ebuild 883
+SHA256 b1f2ca6a914da1121f31026460997814ab0f8a59f1b92f088af69a7be3468851 hsql-1.7.ebuild 883
MD5 c694674dcbef799cd4fdb6914683ebff metadata.xml 223
RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 metadata.xml 223
SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508 metadata.xml 223
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
-iD8DBQFEEzQG/B0cxt+cq+wRAnOsAJ9ecj8mQZrL6/9tGrWAmE1Sf2blZgCfaY6L
-p+YjyxBBVmlrwa39UJmUQG4=
-=Devc
+iD8DBQFEE0GR/B0cxt+cq+wRAg6fAJ951IkZCjodF4NnajWFU1C3LCcXOQCfV/1K
+HVq5ayFO1qLJoJhCEzjMAJw=
+=fGqw
-----END PGP SIGNATURE-----
--- /dev/null
+Index: HSQL/Database/HSQL.hsc
+===================================================================
+RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL.hsc,v
+retrieving revision 1.16
+diff -u -r1.16 HSQL.hsc
+--- HSQL/Database/HSQL.hsc 9 Jan 2006 14:49:23 -0000 1.16
++++ HSQL/Database/HSQL.hsc 11 Mar 2006 20:27:45 -0000
+@@ -239,7 +239,8 @@
+ sqlType==SqlTinyInt ||
+ sqlType==SqlSmallInt||
+ sqlType==SqlBigInt = c_atoi cstr
+- | otherwise = throwDyn (SqlBadTypeCast name sqlType)
++ fromSqlCStringLen field cstr cstrLen
++ = defaultFromSqlCStringLen field cstr cstrLen
+
+ fromSqlValue SqlInteger s = Just (read s)
+ fromSqlValue SqlMedInt s = Just (read s)
+@@ -265,7 +266,8 @@
+ #else
+ c_strtoll cstr nullPtr 10
+ #endif
+- | otherwise = throwDyn (SqlBadTypeCast name sqlType)
++ fromSqlCStringLen field cstr cstrLen
++ = defaultFromSqlCStringLen field cstr cstrLen
+
+ fromSqlValue SqlInteger s = Just (read s)
+ fromSqlValue SqlMedInt s = Just (read s)
+Index: HSQL/Database/HSQL/Types.hs
+===================================================================
+RCS file: /cvsroot/htoolkit/HSQL/HSQL/Database/HSQL/Types.hs,v
+retrieving revision 1.9
+diff -u -r1.9 Types.hs
+--- HSQL/Database/HSQL/Types.hs 9 Jan 2006 14:49:23 -0000 1.9
++++ HSQL/Database/HSQL/Types.hs 11 Mar 2006 20:27:45 -0000
+@@ -150,13 +150,16 @@
+ -- This allows for faster conversion for eq. integral numeric types, etc.
+ -- Default version uses fromSqlValue.
+ fromSqlCStringLen :: FieldDef -> CString -> Int -> IO a
+- fromSqlCStringLen (name,sqlType,_) cstr cstrLen
+- | cstr == nullPtr = throwDyn (SqlFetchNull name)
+- | otherwise = do
+- str <- peekCStringLen (cstr, cstrLen)
+- case fromSqlValue sqlType str of
+- Nothing -> throwDyn (SqlBadTypeCast name sqlType)
+- Just v -> return v
++ fromSqlCStringLen = defaultFromSqlCStringLen
+
+ fromSqlValue :: SqlType -> String -> Maybe a
+ toSqlValue :: a -> String
++
++defaultFromSqlCStringLen :: SqlBind a => FieldDef -> CString -> Int -> IO a
++defaultFromSqlCStringLen (name,sqlType,_) cstr cstrLen
++ | cstr == nullPtr = throwDyn (SqlFetchNull name)
++ | otherwise = do
++ str <- peekCStringLen (cstr, cstrLen)
++ case fromSqlValue sqlType str of
++ Nothing -> throwDyn (SqlBadTypeCast name sqlType)
++ Just v -> return v
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hsql/hsql-1.7.ebuild,v 1.6 2006/03/11 20:33:26 dcoutts Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hsql/hsql-1.7.ebuild,v 1.7 2006/03/11 21:31:06 dcoutts Exp $
CABAL_FEATURES="lib haddock"
-inherit ghc-package haskell-cabal
+inherit base ghc-package haskell-cabal
DESCRIPTION="SQL bindings for Haskell"
HOMEPAGE="http://htoolkit.sourceforge.net/"
S="${WORKDIR}/HSQL/HSQL"
+src_unpack() {
+ base_src_unpack
+
+ cd ${S}
+ epatch "${FILESDIR}/${P}-sqltext-to-int.patch"
+}
+
pkg_postinst () {
ghc-package_pkg_postinst