Hello community, here is the log from the commit of package ghc-esqueleto for openSUSE:Factory checked in at 2017-04-11 09:44:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-esqueleto (Old) and /work/SRC/openSUSE:Factory/.ghc-esqueleto.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-esqueleto" Tue Apr 11 09:44:24 2017 rev:4 rq:485189 version:2.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-esqueleto/ghc-esqueleto.changes 2016-10-20 23:08:15.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-esqueleto.new/ghc-esqueleto.changes 2017-04-11 09:44:30.582619750 +0200 @@ -1,0 +2,13 @@ +Wed Mar 22 09:15:14 UTC 2017 - psimons@suse.com + +- Update to version 2.5.1 revision 1 with cabal2obs. The new + version obsoletes the following patches: + * 0001-Port-to-Stackage-Nightly-and-persistent-2.6.patch + * 0002-Fix-warnings-for-persistent-2.6.patch. + +------------------------------------------------------------------- +Sun Feb 12 14:19:17 UTC 2017 - psimons@suse.com + +- Update to version 2.5.1 with cabal2obs. + +------------------------------------------------------------------- Old: ---- 0001-Port-to-Stackage-Nightly-and-persistent-2.6.patch 0002-Fix-warnings-for-persistent-2.6.patch esqueleto-2.4.3.tar.gz New: ---- esqueleto-2.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-esqueleto.spec ++++++ --- /var/tmp/diff_new_pack.2DXU8p/_old 2017-04-11 09:44:31.386506191 +0200 +++ /var/tmp/diff_new_pack.2DXU8p/_new 2017-04-11 09:44:31.386506191 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-esqueleto # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name esqueleto %bcond_with tests Name: ghc-%{pkg_name} -Version: 2.4.3 +Version: 2.5.1 Release: 0 Summary: Type-safe EDSL for SQL queries on persistent backends License: BSD-3-Clause @@ -27,9 +27,6 @@ Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal -# https://github.com/prowdsponsor/esqueleto/pull/149 -Patch1: 0001-Port-to-Stackage-Nightly-and-persistent-2.6.patch -Patch2: 0002-Fix-warnings-for-persistent-2.6.patch BuildRequires: ghc-Cabal-devel BuildRequires: ghc-blaze-html-devel BuildRequires: ghc-bytestring-devel @@ -74,7 +71,7 @@ Not all SQL features are available, but most of them can be easily added (especially functions), so please open an issue or send a pull request if you need anything that is not covered by 'esqueleto' on -https://github.com/prowdsponsor/esqueleto/. +https://github.com/bitemyapp/esqueleto. The name of this library means "skeleton" in Portuguese and contains all three SQL letters in the correct order =). It was inspired by Scala's Squeryl but @@ -94,8 +91,6 @@ %prep %setup -q -n %{pkg_name}-%{version} cp -p %{SOURCE1} %{pkg_name}.cabal -%patch1 -p1 -%patch2 -p1 %build %ghc_lib_build ++++++ esqueleto-2.4.3.tar.gz -> esqueleto-2.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/esqueleto.cabal new/esqueleto-2.5.1/esqueleto.cabal --- old/esqueleto-2.4.3/esqueleto.cabal 2016-02-12 21:46:46.000000000 +0100 +++ new/esqueleto-2.5.1/esqueleto.cabal 2017-01-22 19:54:35.000000000 +0100 @@ -1,12 +1,12 @@ name: esqueleto -version: 2.4.3 +version: 2.5.1 synopsis: Type-safe EDSL for SQL queries on persistent backends. -homepage: https://github.com/prowdsponsor/esqueleto +homepage: https://github.com/bitemyapp/esqueleto license: BSD3 license-file: LICENSE author: Felipe Lessa -maintainer: felipe.lessa@gmail.com -copyright: (c) 2012-2015 Felipe Almeida Lessa +maintainer: cma@bitemyapp.com +copyright: (c) 2012-2016 Felipe Almeida Lessa category: Database build-type: Simple cabal-version: >=1.8 @@ -36,7 +36,7 @@ Not all SQL features are available, but most of them can be easily added (especially functions), so please open an issue or send a pull request if you need anything that is not covered by @esqueleto@ on - https://github.com/prowdsponsor/esqueleto/. + https://github.com/bitemyapp/esqueleto. . The name of this library means \"skeleton\" in Portuguese and contains all three SQL letters in the correct order =). It was @@ -44,7 +44,7 @@ source-repository head type: git - location: git://github.com/prowdsponsor/esqueleto.git + location: git://github.com/bitemyapp/esqueleto.git Flag postgresql Description: test postgresql. default is to test sqlite. @@ -63,10 +63,10 @@ other-modules: Database.Esqueleto.Internal.PersistentImport build-depends: - base >= 4.5 && < 4.9 + base >= 4.5 && < 5.0 , bytestring , text >= 0.11 && < 1.3 - , persistent >= 2.1.1.7 && < 2.3 + , persistent >= 2.5 && < 2.7 , transformers >= 0.2 , unordered-containers >= 0.2 , tagged >= 0.2 @@ -76,7 +76,10 @@ , resourcet >= 1.1 , blaze-html hs-source-dirs: src/ - ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wall -Wno-redundant-constraints + else + ghc-options: -Wall test-suite test type: exitcode-stdio-1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/Language.hs new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/Language.hs --- old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/Language.hs 2016-02-12 21:45:45.000000000 +0100 +++ new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/Language.hs 2017-01-22 19:46:18.000000000 +0100 @@ -44,7 +44,6 @@ , else_ ) where -import Control.Applicative (Applicative(..), (<$>)) import Control.Exception (Exception) import Data.Int (Int64) import Data.Typeable (Typeable) @@ -52,7 +51,6 @@ import Text.Blaze.Html (Html) import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL import qualified Data.Text as T import qualified Data.Text.Lazy as TL @@ -471,7 +469,7 @@ -- @ -- select $ -- 'from' $ \\person -> do - -- 'where_' $ person '^.' PersonId `in_` 'valList' personIds + -- 'where_' $ person '^.' PersonId `'in_`` 'valList' personIds -- return person -- @ -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/PersistentImport.hs new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/PersistentImport.hs --- old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/PersistentImport.hs 2015-09-02 20:14:43.000000000 +0200 +++ new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/PersistentImport.hs 2017-01-22 19:46:18.000000000 +0100 @@ -5,9 +5,9 @@ ) where import Database.Persist.Sql hiding - ( BackendSpecificFilter, Filter(..), PersistQuery(..), SelectOpt(..) + ( BackendSpecificFilter, Filter(..), PersistQuery, SelectOpt(..) , Update(..), delete, deleteWhereCount, updateWhereCount, selectList , selectKeysList, deleteCascadeWhere, (=.), (+=.), (-=.), (*=.), (/=.) , (==.), (!=.), (<.), (>.), (<=.), (>=.), (<-.), (/<-.), (||.) , listToJSON, mapToJSON, getPersistMap, limitOffsetOrder, selectSource - , update ) + , update , count ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/Sql.hs new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/Sql.hs --- old/esqueleto-2.4.3/src/Database/Esqueleto/Internal/Sql.hs 2016-02-12 21:45:45.000000000 +0100 +++ new/esqueleto-2.5.1/src/Database/Esqueleto/Internal/Sql.hs 2017-01-22 19:46:18.000000000 +0100 @@ -9,6 +9,7 @@ , UndecidableInstances , ScopedTypeVariables , InstanceSigs + , Rank2Types #-} -- | This is an internal module, anything exported by this module -- may change without a major version bump. Please use only @@ -50,17 +51,16 @@ , veryUnsafeCoerceSqlExprValueList ) where -import Control.Applicative (Applicative(..), (<$>), (<$)) import Control.Arrow ((***), first) import Control.Exception (throw, throwIO) -import Control.Monad (ap, MonadPlus(..), liftM) +import Control.Monad (ap, MonadPlus(..), join, void) import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Resource (MonadResource) import Data.Acquire (with, allocateAcquire, Acquire) import Data.Int (Int64) import Data.List (intersperse) -import Data.Monoid (Last(..), Monoid(..), (<>)) +import Data.Monoid (Last(..), (<>)) import Data.Proxy (Proxy(..)) import Database.Esqueleto.Internal.PersistentImport import Database.Persist.Sql.Util (entityColumnNames, entityColumnCount, parseEntityValues, isIdField, hasCompositeKey) @@ -647,7 +647,7 @@ deconstruct :: (TLB.Builder, [PersistValue]) -> ([TLB.Builder], [PersistValue]) deconstruct ("?", [PersistList vals]) = (replicate (length vals) "?", vals) - deconstruct (b, []) = (TLB.fromLazyText <$> TL.splitOn "," (TLB.toLazyText b), []) + deconstruct (b', []) = (TLB.fromLazyText <$> TL.splitOn "," (TLB.toLazyText b'), []) deconstruct x = err $ "cannot deconstruct " ++ show x ++ "." compose f1 f2 info @@ -666,7 +666,7 @@ -- | (Internal) A raw SQL value. The same warning from -- 'unsafeSqlBinOp' applies to this function as well. unsafeSqlValue :: TLB.Builder -> SqlExpr (Value a) -unsafeSqlValue v = ERaw Never $ \_ -> (v, mempty) +unsafeSqlValue v = ERaw Never $ const (v, mempty) {-# INLINE unsafeSqlValue #-} @@ -754,10 +754,10 @@ , MonadIO m2 ) => Mode -> SqlQuery a - -> SqlPersistT m1 (Acquire (C.Source m2 r)) + -> SqlReadT m1 (Acquire (C.Source m2 r)) rawSelectSource mode query = do - conn <- R.ask + conn <- persistBackend <$> R.ask res <- run conn return $ (C.$= massage) `fmap` res where @@ -783,12 +783,9 @@ , MonadResource m ) => SqlQuery a -> C.Source (SqlPersistT m) r -selectSource query = do - src <- lift $ do - res <- rawSelectSource SELECT query - fmap snd $ allocateAcquire res - src - +selectSource query = join . lift $ do + res <- rawSelectSource SELECT query + snd <$> allocateAcquire res -- | Execute an @esqueleto@ @SELECT@ query inside @persistent@'s -- 'SqlPersistT' monad and return a list of rows. @@ -833,7 +830,7 @@ -- @SqlExpr (Entity Person)@. select :: ( SqlSelect a r , MonadIO m ) - => SqlQuery a -> SqlPersistT m [r] + => SqlQuery a -> SqlReadT m [r] select query = do res <- rawSelectSource SELECT query conn <- R.ask @@ -863,8 +860,8 @@ -- | (Internal) Run a 'C.Source' of rows. runSource :: Monad m => - C.Source (SqlPersistT m) r - -> SqlPersistT m [r] + C.Source (R.ReaderT backend m) r + -> R.ReaderT backend m [r] runSource src = src C.$$ CL.consume @@ -873,12 +870,12 @@ -- | (Internal) Execute an @esqueleto@ statement inside -- @persistent@'s 'SqlPersistT' monad. -rawEsqueleto :: ( MonadIO m, SqlSelect a r ) +rawEsqueleto :: ( MonadIO m, SqlSelect a r, IsSqlBackend backend) => Mode -> SqlQuery a - -> SqlPersistT m Int64 + -> R.ReaderT backend m Int64 rawEsqueleto mode query = do - conn <- R.ask + conn <- persistBackend <$> R.ask uncurry rawExecuteCount $ first builderToText $ toRawSql mode (conn, initialIdentState) query @@ -908,14 +905,13 @@ -- @ delete :: ( MonadIO m ) => SqlQuery () - -> SqlPersistT m () -delete = liftM (const ()) . deleteCount - + -> SqlWriteT m () +delete = void . deleteCount -- | Same as 'delete', but returns the number of rows affected. deleteCount :: ( MonadIO m ) => SqlQuery () - -> SqlPersistT m Int64 + -> SqlWriteT m Int64 deleteCount = rawEsqueleto DELETE @@ -927,22 +923,21 @@ -- Example of usage: -- -- @ --- 'update' $ \p -> do +-- 'update' $ \\p -> do -- 'set' p [ PersonAge '=.' 'just' ('val' thisYear) -. p '^.' PersonBorn ] -- 'where_' $ isNothing (p '^.' PersonAge) -- @ update :: ( MonadIO m , SqlEntity val ) => (SqlExpr (Entity val) -> SqlQuery ()) - -> SqlPersistT m () -update = liftM (const ()) . updateCount - + -> SqlWriteT m () +update = void . updateCount -- | Same as 'update', but returns the number of rows affected. updateCount :: ( MonadIO m , SqlEntity val ) => (SqlExpr (Entity val) -> SqlQuery ()) - -> SqlPersistT m Int64 + -> SqlWriteT m Int64 updateCount = rawEsqueleto UPDATE . from @@ -961,7 +956,9 @@ -- @esqueleto@, instead of manually using this function (which is -- possible but tedious), you may just turn on query logging of -- @persistent@. -toRawSql :: SqlSelect a r => Mode -> IdentInfo -> SqlQuery a -> (TLB.Builder, [PersistValue]) +toRawSql + :: (IsSqlBackend backend, SqlSelect a r) + => Mode -> (backend, IdentState) -> SqlQuery a -> (TLB.Builder, [PersistValue]) toRawSql mode (conn, firstIdentState) query = let ((ret, sd), finalIdentState) = flip S.runState firstIdentState $ @@ -980,7 +977,7 @@ -- that were used) to the subsequent calls. This ensures -- that no name clashes will occur on subqueries that may -- appear on the expressions below. - info = (conn, finalIdentState) + info = (persistBackend conn, finalIdentState) in mconcat [ makeInsertInto info mode ret , makeSelect info mode distinctClause ret @@ -1034,7 +1031,7 @@ DistinctOn exprs -> first (("SELECT DISTINCT ON (" <>) . (<> ") ")) $ uncommas' (processExpr <$> exprs) where processExpr (EDistinctOn f) = materializeExpr info f - withCols v = v <> (sqlSelectCols info ret) + withCols v = v <> sqlSelectCols info ret plain v = (v, []) @@ -1119,7 +1116,7 @@ let fs = f info vals = repeat [] in zip (map (<> orderByType t) fs) vals - mk EOrderRandom = [first ((<> "RANDOM()")) mempty] + mk EOrderRandom = [first (<> "RANDOM()") mempty] orderByType ASC = " ASC" orderByType DESC = " DESC" @@ -1212,8 +1209,7 @@ in (process ed, mempty) sqlSelectColCount = entityColumnCount . entityDef . getEntityVal sqlSelectProcessRow = parseEntityValues ed - where ed = entityDef $ getEntityVal $ (Proxy :: Proxy (SqlExpr (Entity a))) - + where ed = entityDef $ getEntityVal (Proxy :: Proxy (SqlExpr (Entity a))) getEntityVal :: Proxy (SqlExpr (Entity a)) -> Proxy a getEntityVal = const Proxy @@ -1745,17 +1741,17 @@ -- -- /Since: 2.4.2/ insertSelect :: (MonadIO m, PersistEntity a) => - SqlQuery (SqlExpr (Insertion a)) -> SqlPersistT m () -insertSelect = liftM (const ()) . insertSelectCount + SqlQuery (SqlExpr (Insertion a)) -> SqlWriteT m () +insertSelect = void . insertSelectCount -- | Insert a 'PersistField' for every selected value, return the count afterward insertSelectCount :: (MonadIO m, PersistEntity a) => - SqlQuery (SqlExpr (Insertion a)) -> SqlPersistT m Int64 + SqlQuery (SqlExpr (Insertion a)) -> SqlWriteT m Int64 insertSelectCount = rawEsqueleto INSERT_INTO . fmap EInsertFinal -- | Insert a 'PersistField' for every unique selected value. insertSelectDistinct :: (MonadIO m, PersistEntity a) => - SqlQuery (SqlExpr (Insertion a)) -> SqlPersistT m () + SqlQuery (SqlExpr (Insertion a)) -> SqlWriteT m () insertSelectDistinct = insertSelect . distinct {-# DEPRECATED insertSelectDistinct "Since 2.2.4: use 'insertSelect' and 'distinct'." #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/src/Database/Esqueleto.hs new/esqueleto-2.5.1/src/Database/Esqueleto.hs --- old/esqueleto-2.4.3/src/Database/Esqueleto.hs 2016-02-12 21:45:42.000000000 +0100 +++ new/esqueleto-2.5.1/src/Database/Esqueleto.hs 2017-01-22 19:46:18.000000000 +0100 @@ -14,14 +14,14 @@ -- @ -- -- For a module that mostly uses esqueleto. -- import Database.Esqueleto --- import qualified Database.Persistent as P +-- import qualified Database.Persist as P -- @ -- -- or import @esqueleto@ itself qualified: -- -- @ -- -- For a module that uses esqueleto just on some queries. --- import Database.Persistent +-- import Database.Persist -- import qualified Database.Esqueleto as E -- @ -- @@ -430,8 +430,9 @@ -- | Synonym for 'Database.Persist.Store.delete' that does not -- clash with @esqueleto@'s 'delete'. -deleteKey :: ( PersistStore (PersistEntityBackend val) +deleteKey :: ( PersistStore backend + , BaseBackend backend ~ PersistEntityBackend val , MonadIO m , PersistEntity val ) - => Key val -> ReaderT (PersistEntityBackend val) m () + => Key val -> ReaderT backend m () deleteKey = Database.Persist.delete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/esqueleto-2.4.3/test/Test.hs new/esqueleto-2.5.1/test/Test.hs --- old/esqueleto-2.4.3/test/Test.hs 2016-02-12 21:45:45.000000000 +0100 +++ new/esqueleto-2.5.1/test/Test.hs 2017-01-22 19:46:18.000000000 +0100 @@ -18,18 +18,13 @@ #-} module Main (main) where -import Control.Applicative ((<$>)) -import Control.Arrow ((&&&)) -import Control.Exception (IOException) import Control.Monad (forM_, replicateM, replicateM_, void) import Control.Monad.IO.Class (MonadIO(liftIO)) import Control.Monad.Logger (MonadLogger(..), runStderrLoggingT, runNoLoggingT) import Control.Monad.Trans.Control (MonadBaseControl(..)) import Control.Monad.Trans.Reader (ReaderT) import Data.Char (toLower, toUpper) -import Data.List (sortBy) import Data.Monoid ((<>)) -import Data.Ord (comparing) import Database.Esqueleto #if defined (WITH_POSTGRESQL) import Database.Persist.Postgresql (withPostgresqlConn) @@ -53,7 +48,6 @@ import qualified Data.List as L import qualified Data.Set as S import qualified Data.Text.Lazy.Builder as TLB -import qualified Database.Esqueleto.PostgreSQL as EP import qualified Database.Esqueleto.Internal.Sql as EI @@ -154,7 +148,7 @@ it "works for a single NULL value" $ run $ do - ret <- select $ return $ nothing + ret <- select $ return nothing liftIO $ ret `shouldBe` [ Value (Nothing :: Maybe Int) ] describe "select/from" $ do @@ -289,7 +283,7 @@ number = 101 Right thePk = keyFromValues [toPersistValue number] fcPk <- insert fc - [Entity _ ret] <- select $ from $ return + [Entity _ ret] <- select $ from return liftIO $ do ret `shouldBe` fc fcPk `shouldBe` thePk @@ -1396,10 +1390,11 @@ insert' :: ( Functor m - , PersistStore (PersistEntityBackend val) + , BaseBackend backend ~ PersistEntityBackend val + , PersistStore backend , MonadIO m , PersistEntity val ) - => val -> ReaderT (PersistEntityBackend val) m (Entity val) + => val -> ReaderT backend m (Entity val) insert' v = flip Entity v <$> insert v ++++++ esqueleto.cabal ++++++ --- /var/tmp/diff_new_pack.2DXU8p/_old 2017-04-11 09:44:31.482492631 +0200 +++ /var/tmp/diff_new_pack.2DXU8p/_new 2017-04-11 09:44:31.482492631 +0200 @@ -1,13 +1,13 @@ name: esqueleto -version: 2.4.3 +version: 2.5.1 x-revision: 1 synopsis: Type-safe EDSL for SQL queries on persistent backends. -homepage: https://github.com/prowdsponsor/esqueleto +homepage: https://github.com/bitemyapp/esqueleto license: BSD3 license-file: LICENSE author: Felipe Lessa -maintainer: felipe.lessa@gmail.com -copyright: (c) 2012-2015 Felipe Almeida Lessa +maintainer: cma@bitemyapp.com +copyright: (c) 2012-2016 Felipe Almeida Lessa category: Database build-type: Simple cabal-version: >=1.8 @@ -37,7 +37,7 @@ Not all SQL features are available, but most of them can be easily added (especially functions), so please open an issue or send a pull request if you need anything that is not covered by @esqueleto@ on - https://github.com/prowdsponsor/esqueleto/. + https://github.com/bitemyapp/esqueleto. . The name of this library means \"skeleton\" in Portuguese and contains all three SQL letters in the correct order =). It was @@ -45,7 +45,7 @@ source-repository head type: git - location: git://github.com/prowdsponsor/esqueleto.git + location: git://github.com/bitemyapp/esqueleto.git Flag postgresql Description: test postgresql. default is to test sqlite. @@ -64,10 +64,10 @@ other-modules: Database.Esqueleto.Internal.PersistentImport build-depends: - base >= 4.5 && < 4.10 + base >= 4.8 && < 5.0 , bytestring , text >= 0.11 && < 1.3 - , persistent >= 2.1.1.7 && < 2.3 + , persistent >= 2.5 && < 2.7 , transformers >= 0.2 , unordered-containers >= 0.2 , tagged >= 0.2 @@ -77,7 +77,10 @@ , resourcet >= 1.1 , blaze-html hs-source-dirs: src/ - ghc-options: -Wall + if impl(ghc >= 8.0) + ghc-options: -Wall -Wno-redundant-constraints + else + ghc-options: -Wall test-suite test type: exitcode-stdio-1.0