Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-cborg-json for openSUSE:Factory checked in at 2021-11-11 21:36:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-cborg-json (Old) and /work/SRC/openSUSE:Factory/.ghc-cborg-json.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-cborg-json" Thu Nov 11 21:36:18 2021 rev:6 rq:930315 version:0.2.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-cborg-json/ghc-cborg-json.changes 2021-05-11 23:04:12.148946160 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-cborg-json.new.1890/ghc-cborg-json.changes 2021-11-11 21:36:23.992887683 +0100 @@ -1,0 +2,8 @@ +Mon Nov 1 08:31:11 UTC 2021 - [email protected] + +- Update cborg-json to version 0.2.3.0. + ## 0.2.3.0 -- 2021-10-31 + + * Support for `aeson-2.0`, GHC 9.0, GHC 9.2, and `bytestring-0.11`. + +------------------------------------------------------------------- Old: ---- cborg-json-0.2.2.0.tar.gz cborg-json.cabal New: ---- cborg-json-0.2.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-cborg-json.spec ++++++ --- /var/tmp/diff_new_pack.SayNbT/_old 2021-11-11 21:36:24.448888016 +0100 +++ /var/tmp/diff_new_pack.SayNbT/_new 2021-11-11 21:36:24.448888016 +0100 @@ -18,13 +18,12 @@ %global pkg_name cborg-json Name: ghc-%{pkg_name} -Version: 0.2.2.0 +Version: 0.2.3.0 Release: 0 Summary: A library for encoding JSON as CBOR License: BSD-3-Clause 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/3.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-aeson-pretty-devel @@ -52,7 +51,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ cborg-json-0.2.2.0.tar.gz -> cborg-json-0.2.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cborg-json-0.2.2.0/ChangeLog.md new/cborg-json-0.2.3.0/ChangeLog.md --- old/cborg-json-0.2.2.0/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 +++ new/cborg-json-0.2.3.0/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,9 @@ # Revision history for cborg-json +## 0.2.3.0 -- 2021-10-31 + +* Support for `aeson-2.0`, GHC 9.0, GHC 9.2, and `bytestring-0.11`. + ## 0.2.2.0 -- 2019-12-29 * Use `replicateM` to significantly speed up decoding. Now faster than Aeson! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cborg-json-0.2.2.0/cborg-json.cabal new/cborg-json-0.2.3.0/cborg-json.cabal --- old/cborg-json-0.2.2.0/cborg-json.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/cborg-json-0.2.3.0/cborg-json.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: cborg-json -version: 0.2.2.0 +version: 0.2.3.0 synopsis: A library for encoding JSON as CBOR description: This package implements the bijection between JSON and CBOR defined in the CBOR specification, RFC 7049. @@ -17,14 +17,20 @@ extra-source-files: ChangeLog.md cabal-version: >=1.10 tested-with: - GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC==8.8.1 + GHC == 8.0.2, + GHC == 8.2.2, + GHC == 8.4.4, + GHC == 8.6.5, + GHC == 8.8.3, + GHC == 8.10.1, + GHC == 9.0.1 library exposed-modules: Codec.CBOR.JSON ghc-options: -Wall build-depends: - base >=4.7 && < 4.14, - aeson >=0.7 && <1.5, + base >=4.7 && < 4.17, + aeson >=0.7 && <2.1, aeson-pretty >=0.8 && <0.9, unordered-containers >=0.2 && <0.3, scientific >=0.3 && <0.4, @@ -51,11 +57,11 @@ other-modules: build-depends: - base >= 4.6 && < 5.0, + base >= 4.6 && < 4.17, cborg , cborg-json , aeson , - bytestring >= 0.10.4 && < 0.11, + bytestring >= 0.10.4 && < 0.12, criterion >= 1.0 && < 1.6, deepseq >= 1.0 && < 1.5, directory, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cborg-json-0.2.2.0/src/Codec/CBOR/JSON.hs new/cborg-json-0.2.3.0/src/Codec/CBOR/JSON.hs --- old/cborg-json-0.2.2.0/src/Codec/CBOR/JSON.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/cborg-json-0.2.3.0/src/Codec/CBOR/JSON.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} module Codec.CBOR.JSON ( encodeValue @@ -13,11 +14,17 @@ import Codec.CBOR.Decoding import Data.Aeson ( Value(..) ) import qualified Data.Aeson as Aeson -import qualified Data.HashMap.Lazy as HM import Data.Scientific as Scientific import qualified Data.Text as T import qualified Data.Vector as V +#if MIN_VERSION_aeson(2,0,0) +import qualified Data.Aeson.Key as K +import qualified Data.Aeson.KeyMap as KM +#else +import qualified Data.HashMap.Lazy as HM +#endif + -- | Encode a JSON value into CBOR. encodeValue :: Value -> Encoding encodeValue (Object vs) = encodeObject vs @@ -31,8 +38,18 @@ encodeObject :: Aeson.Object -> Encoding encodeObject vs = - encodeMapLen (fromIntegral (HM.size vs)) - <> HM.foldrWithKey (\k v r -> encodeString k <> encodeValue v <> r) mempty vs + encodeMapLen (fromIntegral size) + <> foldrWithKey (\k v r -> encodeString' k <> encodeValue v <> r) mempty vs + where +#if MIN_VERSION_aeson(2,0,0) + size = KM.size vs + foldrWithKey = KM.foldrWithKey + encodeString' = encodeString . K.toText +#else + size = HM.size vs + foldrWithKey = HM.foldrWithKey + encodeString' = encodeString +#endif encodeArray :: Aeson.Array -> Encoding encodeArray vs = @@ -58,7 +75,7 @@ TypeListLen -> decodeListLen >>= decodeListN lenient TypeListLenIndef -> decodeListLenIndef >> decodeListIndef lenient [] - TypeMapLen -> decodeMapLen >>= flip (decodeMapN lenient) HM.empty + TypeMapLen -> decodeMapLen >>= flip (decodeMapN lenient) mempty _ -> fail $ "unexpected CBOR token type for a JSON value: " ++ show tkty @@ -101,4 +118,10 @@ Bool b | lenient -> return $ T.pack (show b) _ -> fail "Could not decode map key type" !tv <- decodeValue lenient - decodeMapN lenient (n-1) (HM.insert tk tv acc) + decodeMapN lenient (n-1) (insert tk tv acc) + where +#if MIN_VERSION_aeson(2,0,0) + insert k v m = KM.insert (K.fromText k) v m +#else + insert k v m = HM.insert k v m +#endif
