Hello community, here is the log from the commit of package ghc-http-api-data for openSUSE:Factory checked in at 2019-06-12 13:17:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-http-api-data (Old) and /work/SRC/openSUSE:Factory/.ghc-http-api-data.new.4811 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-http-api-data" Wed Jun 12 13:17:55 2019 rev:14 rq:709187 version:0.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-http-api-data/ghc-http-api-data.changes 2018-12-06 12:16:25.853576892 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-http-api-data.new.4811/ghc-http-api-data.changes 2019-06-12 13:17:57.732588292 +0200 @@ -1,0 +2,9 @@ +Sun May 26 09:27:02 UTC 2019 - psimons@suse.com + +- Update http-api-data to version 0.4.1. + Upstream has edited the change log file since the last release in + a non-trivial way, i.e. they did more than just add a new entry + at the top. You can review the file at: + http://hackage.haskell.org/package/http-api-data-0.4.1/src/CHANGELOG.md + +------------------------------------------------------------------- Old: ---- http-api-data-0.4.tar.gz New: ---- http-api-data-0.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-http-api-data.spec ++++++ --- /var/tmp/diff_new_pack.gyPSP6/_old 2019-06-12 13:17:58.416587980 +0200 +++ /var/tmp/diff_new_pack.gyPSP6/_new 2019-06-12 13:17:58.416587980 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-http-api-data # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 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 http-api-data %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.4 +Version: 0.4.1 Release: 0 Summary: Converting to/from HTTP API data like URL pieces, headers and query parameters License: BSD-2-Clause @@ -39,8 +39,7 @@ BuildRequires: ghc-rpm-macros BuildRequires: ghc-tagged-devel BuildRequires: ghc-text-devel -BuildRequires: ghc-time-devel -BuildRequires: ghc-time-locale-compat-devel +BuildRequires: ghc-time-compat-devel BuildRequires: ghc-unordered-containers-devel BuildRequires: ghc-uuid-types-devel %if %{with tests} ++++++ http-api-data-0.4.tar.gz -> http-api-data-0.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/CHANGELOG.md new/http-api-data-0.4.1/CHANGELOG.md --- old/http-api-data-0.4/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,8 @@ +0.4.1 +----- + +* Use `time-compat` to provide instances for `DayOfWeek`. + 0.4 --- @@ -18,7 +23,7 @@ * GHC-8.6 support * Remove dependency on `uri-bytestring` and use functions from `http-types` instead - (see [#75](https://github.com/fizruk/http-api-data/pull/78)) + (see [#75](https://github.com/fizruk/http-api-data/pull/75)) * Add support for `SetCookie` (see [#74](https://github.com/fizruk/http-api-data/pull/74)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/http-api-data.cabal new/http-api-data-0.4.1/http-api-data.cabal --- old/http-api-data-0.4/http-api-data.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/http-api-data.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: http-api-data -version: 0.4 +version: 0.4.1 synopsis: Converting to/from HTTP API data like URL pieces, headers and query parameters. category: Web @@ -29,7 +29,8 @@ GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, - GHC==8.6.2 + GHC==8.6.5, + GHC==8.8.1 custom-setup setup-depends: @@ -51,7 +52,10 @@ , bytestring >= 0.10.4.0 && < 0.11 , containers >= 0.5.5.1 && < 0.7 , text >= 1.2.3.0 && < 1.3 - , time >= 1.4.2 && < 1.9 + + -- so Semigroup Builder exists + if impl(ghc >= 8.0) + build-depends: bytestring >= 0.10.8.1 -- other-dependencies build-depends: @@ -59,24 +63,24 @@ , attoparsec-iso8601 >= 1.0.1.0 && < 1.1 , base-compat >= 0.10.5 && < 0.11 , cookie >= 0.4.3 && < 0.4.5 - , hashable >= 1.2.7.0 && < 1.3 - , http-types >= 0.12.2 && < 0.13 + , hashable >= 1.2.7.0 && < 1.4 + , http-types >= 0.12.3 && < 0.13 , tagged >= 0.8.5 && < 0.9 - , time-locale-compat >= 0.1.1.5 && < 0.2 - , unordered-containers >= 0.2.9.0 && < 0.3 + , time-compat >= 1.9.2 && < 1.10 + , unordered-containers >= 0.2.10.0 && < 0.3 , uuid-types >= 1.0.3 && <1.1 if !impl(ghc >= 7.10) build-depends: nats >= 1.1.2 && < 1.2, - void >= 0.7.2 && < 0.8 + void >= 0.7.3 && < 0.8 if !impl(ghc >= 8.0) - build-depends: semigroups >= 0.18.5 && < 0.19 + build-depends: semigroups >= 0.18.5 && < 0.20 if flag(use-text-show) cpp-options: -DUSE_TEXT_SHOW - build-depends: text-show >= 3.7.4 && <3.8 + build-depends: text-show >= 3.8.2 && <3.9 exposed-modules: Web.HttpApiData @@ -96,7 +100,7 @@ hs-source-dirs: test ghc-options: -Wall default-language: Haskell2010 - build-tool-depends: hspec-discover:hspec-discover >= 2.6.0 && <2.7 + build-tool-depends: hspec-discover:hspec-discover >= 2.7.1 && <2.8 -- inherited depndencies build-depends: base @@ -106,14 +110,14 @@ , http-api-data , nats , text - , time + , time-compat , unordered-containers , uuid-types build-depends: HUnit >= 1.6.0.0 && <1.7 - , hspec >= 2.6.0 && <2.7 - , QuickCheck >= 2.11.3 && <2.13 - , quickcheck-instances >= 0.3.19 && <0.4 + , hspec >= 2.7.1 && <2.8 + , QuickCheck >= 2.13.1 && <2.14 + , quickcheck-instances >= 0.3.21 && <0.4 test-suite doctests ghc-options: -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/src/Web/HttpApiData.hs new/http-api-data-0.4.1/src/Web/HttpApiData.hs --- old/http-api-data-0.4/src/Web/HttpApiData.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/src/Web/HttpApiData.hs 2001-09-09 03:46:40.000000000 +0200 @@ -49,10 +49,9 @@ -- -- >>> :set -XOverloadedStrings -- >>> import Control.Applicative --- >>> import Data.Time +-- >>> import Data.Time.Compat -- >>> import Data.Int -- >>> import Data.Text (Text) --- >>> import Data.Time (Day) -- >>> import Data.Version -- $examples diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/src/Web/Internal/FormUrlEncoded.hs new/http-api-data-0.4.1/src/Web/Internal/FormUrlEncoded.hs --- old/http-api-data-0.4/src/Web/Internal/FormUrlEncoded.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/src/Web/Internal/FormUrlEncoded.hs 2001-09-09 03:46:40.000000000 +0200 @@ -48,7 +48,7 @@ import qualified Data.Text.Encoding as Text import Data.Text.Encoding.Error (lenientDecode) import qualified Data.Text.Lazy as Lazy -import Data.Time (Day, LocalTime, NominalDiffTime, +import Data.Time.Compat (Day, LocalTime, NominalDiffTime, UTCTime, ZonedTime) import Data.Void (Void) import Data.Word (Word16, Word32, Word64, Word8) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/src/Web/Internal/HttpApiData.hs new/http-api-data-0.4.1/src/Web/Internal/HttpApiData.hs --- old/http-api-data-0.4/src/Web/Internal/HttpApiData.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/src/Web/Internal/HttpApiData.hs 2001-09-09 03:46:40.000000000 +0200 @@ -28,6 +28,7 @@ import Data.Data (Data) import qualified Data.Fixed as F import Data.Int (Int16, Int32, Int64, Int8) +import qualified Data.Map as Map import Data.Monoid (All (..), Any (..), Dual (..), First (..), Last (..), Product (..), Sum (..)) @@ -42,10 +43,13 @@ import qualified Data.Text.Lazy as L import Data.Text.Read (Reader, decimal, rational, signed) -import Data.Time (Day, FormatTime, LocalTime, +import Data.Time.Compat (Day, FormatTime, LocalTime, NominalDiffTime, TimeOfDay, - UTCTime, ZonedTime, formatTime) -import Data.Time.Locale.Compat (defaultTimeLocale, + UTCTime, ZonedTime, formatTime, + DayOfWeek (..), + nominalDiffTimeToSeconds, + secondsToNominalDiffTime) +import Data.Time.Format.Compat (defaultTimeLocale, iso8601DateFormat) import Data.Typeable (Typeable) import qualified Data.UUID.Types as UUID @@ -60,10 +64,6 @@ import Web.Cookie (SetCookie, parseSetCookie, renderSetCookie) -#if MIN_VERSION_time(1,9,1) -import Data.Time (nominalDiffTimeToSeconds, - secondsToNominalDiffTime) -#endif #if USE_TEXT_SHOW import TextShow (TextShow, showt) @@ -75,7 +75,7 @@ -- $setup -- >>> data BasicAuthToken = BasicAuthToken Text deriving (Show) -- >>> instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h; parseQueryParam p = BasicAuthToken <$> parseQueryParam p --- >>> import Data.Time +-- >>> import Data.Time.Compat -- >>> import Data.Version -- | Convert value to HTTP API data. @@ -495,28 +495,23 @@ toUrlPiece = timeToUrlPiece "%H:%M:%S%QZ" toEncodedUrlPiece = unsafeToEncodedUrlPiece --- The CPP in both this function and the function after it are to avoid --- exporting @nominalDiffTimeToSeconds@ and @secondsToNominalDiffTime@, --- since these names are already used by @Data.Time@ from the @time@ library --- starting in version @1.9.1@. -nominalDiffTimeToSecs :: NominalDiffTime -> F.Pico -nominalDiffTimeToSecs = -#if !MIN_VERSION_time(1,9,1) - realToFrac -#else - nominalDiffTimeToSeconds -#endif +-- | +-- >>> toUrlPiece Monday +-- "monday" +instance ToHttpApiData DayOfWeek where + toUrlPiece Monday = "monday" + toUrlPiece Tuesday = "tuesday" + toUrlPiece Wednesday = "wednesday" + toUrlPiece Thursday = "thursday" + toUrlPiece Friday = "friday" + toUrlPiece Saturday = "saturday" + toUrlPiece Sunday = "sunday" + + toEncodedUrlPiece = unsafeToEncodedUrlPiece -secsToNominalDiffTime :: F.Pico -> NominalDiffTime -secsToNominalDiffTime = -#if !MIN_VERSION_time(1,9,1) - realToFrac -#else - secondsToNominalDiffTime -#endif instance ToHttpApiData NominalDiffTime where - toUrlPiece = toUrlPiece . nominalDiffTimeToSecs + toUrlPiece = toUrlPiece . nominalDiffTimeToSeconds toEncodedUrlPiece = unsafeToEncodedUrlPiece instance ToHttpApiData String where toUrlPiece = T.pack @@ -686,7 +681,16 @@ -- Right 2015-10-03 00:14:24 UTC instance FromHttpApiData UTCTime where parseUrlPiece = runAtto Atto.utcTime -instance FromHttpApiData NominalDiffTime where parseUrlPiece = fmap secsToNominalDiffTime . parseUrlPiece +instance FromHttpApiData DayOfWeek where + parseUrlPiece t = case Map.lookup (T.toLower t) m of + Just dow -> Right dow + Nothing -> Left $ "Incorrect DayOfWeek: " <> T.take 10 t + where + m :: Map.Map Text DayOfWeek + m = Map.fromList [ (toUrlPiece dow, dow) | dow <- [Monday .. Sunday] ] + + +instance FromHttpApiData NominalDiffTime where parseUrlPiece = fmap secondsToNominalDiffTime . parseUrlPiece instance FromHttpApiData All where parseUrlPiece = coerce (parseUrlPiece :: Text -> Either Text Bool) instance FromHttpApiData Any where parseUrlPiece = coerce (parseUrlPiece :: Text -> Either Text Bool) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/test/Web/Internal/HttpApiDataSpec.hs new/http-api-data-0.4.1/test/Web/Internal/HttpApiDataSpec.hs --- old/http-api-data-0.4/test/Web/Internal/HttpApiDataSpec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/test/Web/Internal/HttpApiDataSpec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -13,7 +13,7 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as TE import qualified Data.Text.Lazy as L -import Data.Time +import Data.Time.Compat import qualified Data.UUID.Types as UUID import Data.Version import Data.Word @@ -86,6 +86,7 @@ checkUrlPiece (Proxy :: Proxy ZonedTime) "ZonedTime" checkUrlPiece (Proxy :: Proxy UTCTime) "UTCTime" checkUrlPiece (Proxy :: Proxy NominalDiffTime) "NominalDiffTime" + checkUrlPiece (Proxy :: Proxy DayOfWeek) "DayOfWeek" checkUrlPiece (Proxy :: Proxy Version) "Version" checkUrlPiece (Proxy :: Proxy UUID.UUID) "UUID" checkUrlPiece' setCookieGen "Cookie" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-api-data-0.4/test/Web/Internal/TestInstances.hs new/http-api-data-0.4.1/test/Web/Internal/TestInstances.hs --- old/http-api-data-0.4/test/Web/Internal/TestInstances.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/http-api-data-0.4.1/test/Web/Internal/TestInstances.hs 2001-09-09 03:46:40.000000000 +0200 @@ -12,7 +12,7 @@ import Data.Char import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as T -import Data.Time +import Data.Time.Compat import GHC.Exts (fromList) import GHC.Generics