diff -Nru haskell-postgresql-libpq-0.9.2.0/debian/changelog haskell-postgresql-libpq-0.9.3.1/debian/changelog --- haskell-postgresql-libpq-0.9.2.0/debian/changelog 2017-01-24 10:45:38.000000000 +0000 +++ haskell-postgresql-libpq-0.9.3.1/debian/changelog 2017-06-17 19:44:17.000000000 +0000 @@ -1,8 +1,8 @@ -haskell-postgresql-libpq (0.9.2.0-3build1) zesty; urgency=medium +haskell-postgresql-libpq (0.9.3.1-1) unstable; urgency=medium - * Rebuild against new GHC ABI. + * New upstream release - -- Gianfranco Costamagna Tue, 24 Jan 2017 11:45:38 +0100 + -- Clint Adams Sat, 17 Jun 2017 15:44:17 -0400 haskell-postgresql-libpq (0.9.2.0-3) unstable; urgency=medium diff -Nru haskell-postgresql-libpq-0.9.2.0/postgresql-libpq.cabal haskell-postgresql-libpq-0.9.3.1/postgresql-libpq.cabal --- haskell-postgresql-libpq-0.9.2.0/postgresql-libpq.cabal 2016-08-25 20:35:33.000000000 +0000 +++ haskell-postgresql-libpq-0.9.3.1/postgresql-libpq.cabal 2017-05-15 05:45:38.000000000 +0000 @@ -1,5 +1,5 @@ Name: postgresql-libpq -Version: 0.9.2.0 +Version: 0.9.3.1 Synopsis: low-level binding to libpq Description: This is a binding to libpq: the C application @@ -54,4 +54,4 @@ source-repository this type: git location: http://github.com/lpsmith/postgresql-libpq - tag: v0.9.2.0 + tag: v0.9.3.1 diff -Nru haskell-postgresql-libpq-0.9.2.0/Setup.hs haskell-postgresql-libpq-0.9.3.1/Setup.hs --- haskell-postgresql-libpq-0.9.2.0/Setup.hs 2016-08-25 20:35:33.000000000 +0000 +++ haskell-postgresql-libpq-0.9.3.1/Setup.hs 2017-05-15 05:45:38.000000000 +0000 @@ -1,4 +1,8 @@ -#!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} + +#ifndef MIN_VERSION_Cabal +#define MIN_VERSION_Cabal(x,y,z) 0 +#endif import Distribution.Simple import Distribution.Simple.Setup @@ -12,9 +16,28 @@ import Data.Char (isSpace) import Data.List (dropWhile,reverse) +#if MIN_VERSION_Cabal(2,0,0) +import Distribution.Types.UnqualComponentName +#endif + +flag :: String -> FlagName +#if MIN_VERSION_Cabal(2,0,0) +flag = mkFlagName +#else +flag = FlagName +#endif + +#if MIN_VERSION_Cabal(2,0,0) +unqualComponentName :: String -> UnqualComponentName +unqualComponentName = mkUnqualComponentName +#else +unqualComponentName :: String -> String +unqualComponentName = id +#endif + main = defaultMainWithHooks simpleUserHooks { confHook = \pkg flags -> do - if lookup (FlagName "use-pkg-config") + if lookup (flag "use-pkg-config") (configConfigurationsFlags flags) == Just True then do confHook simpleUserHooks pkg flags @@ -24,7 +47,7 @@ return lbi { localPkgDescr = updatePackageDescription - (Just bi, [("runtests", bi)]) (localPkgDescr lbi) + (Just bi, [(unqualComponentName "runtests", bi)]) (localPkgDescr lbi) } } @@ -32,7 +55,7 @@ psqlBuildInfo lbi = do (pgconfigProg, _) <- requireProgram verbosity (simpleProgram "pg_config") (withPrograms lbi) - let pgconfig = rawSystemProgramStdout verbosity pgconfigProg + let pgconfig = getProgramOutput verbosity pgconfigProg incDir <- pgconfig ["--includedir"] libDir <- pgconfig ["--libdir"] diff -Nru haskell-postgresql-libpq-0.9.2.0/src/Database/PostgreSQL/LibPQ.hsc haskell-postgresql-libpq-0.9.3.1/src/Database/PostgreSQL/LibPQ.hsc --- haskell-postgresql-libpq-0.9.2.0/src/Database/PostgreSQL/LibPQ.hsc 2016-08-25 20:35:33.000000000 +0000 +++ haskell-postgresql-libpq-0.9.3.1/src/Database/PostgreSQL/LibPQ.hsc 2017-05-15 05:45:38.000000000 +0000 @@ -961,6 +961,7 @@ -- transfer started. | CopyIn -- ^ Copy In (to server) data transfer -- started. + | CopyBoth -- ^ Copy In/Out data transfer started. | BadResponse -- ^ The server's response was not understood. | NonfatalError -- ^ A nonfatal error (a notice or -- warning) occurred. @@ -977,6 +978,7 @@ toEnum (#const PGRES_TUPLES_OK) = TuplesOk toEnum (#const PGRES_COPY_OUT) = CopyOut toEnum (#const PGRES_COPY_IN) = CopyIn + toEnum (#const PGRES_COPY_BOTH) = CopyBoth toEnum (#const PGRES_BAD_RESPONSE) = BadResponse toEnum (#const PGRES_NONFATAL_ERROR) = NonfatalError toEnum (#const PGRES_FATAL_ERROR) = FatalError @@ -988,6 +990,7 @@ fromEnum TuplesOk = (#const PGRES_TUPLES_OK) fromEnum CopyOut = (#const PGRES_COPY_OUT) fromEnum CopyIn = (#const PGRES_COPY_IN) + fromEnum CopyBoth = (#const PGRES_COPY_BOTH) fromEnum BadResponse = (#const PGRES_BAD_RESPONSE) fromEnum NonfatalError = (#const PGRES_NONFATAL_ERROR) fromEnum FatalError = (#const PGRES_FATAL_ERROR) @@ -2113,10 +2116,13 @@ -- later call 'disableNoticeReporting' after calling this function. enableNoticeReporting :: Connection -> IO () enableNoticeReporting conn@(Conn _ nbRef) = do - nb' <- c_malloc_noticebuffer - _ <- withConn conn $ \c -> c_PQsetNoticeReceiver c p_store_notices nb' - nb <- swapMVar nbRef nb' - c_free_noticebuffer nb + if isNullConnection conn + then return () + else do + nb' <- c_malloc_noticebuffer + _ <- withConn conn $ \c -> c_PQsetNoticeReceiver c p_store_notices nb' + nb <- swapMVar nbRef nb' + c_free_noticebuffer nb -- | This function retrieves any notices received from the backend. -- Because multiple notices can be received at a time, you will