Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-canonical-json for openSUSE:Factory checked in at 2022-10-13 15:41:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-canonical-json (Old) and /work/SRC/openSUSE:Factory/.ghc-canonical-json.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-canonical-json" Thu Oct 13 15:41:20 2022 rev:3 rq:1008443 version:0.6.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-canonical-json/ghc-canonical-json.changes 2020-12-22 11:37:05.301356893 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-canonical-json.new.2275/ghc-canonical-json.changes 2022-10-13 15:41:26.374655277 +0200 @@ -1,0 +2,14 @@ +Tue Sep 20 10:03:32 UTC 2022 - Peter Simons <[email protected]> + +- Update canonical-json to version 0.6.0.1. + ## 0.6.0.1 2022-09-19 + + * Support GHC 9.2 and 9.4, and bytestring 0.11.x + + * Support recent versions of QuickCheck and Aeson in the tests + + * Fix the domain of a property test `prop_aeson_canonical` + + * Add CI on github covering GHC versions 8.0, 8.2, 8.4, 8.6, 8.8, 8.10, 9.2 + +------------------------------------------------------------------- Old: ---- canonical-json-0.6.0.0.tar.gz canonical-json.cabal New: ---- canonical-json-0.6.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-canonical-json.spec ++++++ --- /var/tmp/diff_new_pack.JnHq0e/_old 2022-10-13 15:41:27.190656870 +0200 +++ /var/tmp/diff_new_pack.JnHq0e/_new 2022-10-13 15:41:27.198656884 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-canonical-json # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,12 @@ %global pkg_name canonical-json %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.6.0.0 +Version: 0.6.0.1 Release: 0 Summary: Canonical JSON for signing and hashing JSON values 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/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-bytestring-devel BuildRequires: ghc-containers-devel @@ -69,7 +68,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ canonical-json-0.6.0.0.tar.gz -> canonical-json-0.6.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/canonical-json-0.6.0.0/ChangeLog.md new/canonical-json-0.6.0.1/ChangeLog.md --- old/canonical-json-0.6.0.0/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 +++ new/canonical-json-0.6.0.1/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,15 @@ # Revision history for canonical-json +## 0.6.0.1 2022-09-19 + +* Support GHC 9.2 and 9.4, and bytestring 0.11.x + +* Support recent versions of QuickCheck and Aeson in the tests + +* Fix the domain of a property test `prop_aeson_canonical` + +* Add CI on github covering GHC versions 8.0, 8.2, 8.4, 8.6, 8.8, 8.10, 9.2 + ## 0.6.0.0 2019-07-31 * Introduced JSString type rather than using String, for improved memory use. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/canonical-json-0.6.0.0/Text/JSON/Canonical/Parse.hs new/canonical-json-0.6.0.1/Text/JSON/Canonical/Parse.hs --- old/canonical-json-0.6.0.0/Text/JSON/Canonical/Parse.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/canonical-json-0.6.0.1/Text/JSON/Canonical/Parse.hs 2001-09-09 03:46:40.000000000 +0200 @@ -232,7 +232,7 @@ manyN :: Int -> Parser a -> Parser [a] manyN 0 _ = pure [] -manyN n p = ((:) <$> p <*> manyN (n-1) p) +manyN n p = ((:) <$> p <*> manyN (n - 1) p) <|> pure [] ------------------------------------------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/canonical-json-0.6.0.0/Text/JSON/Canonical/Types.hs new/canonical-json-0.6.0.1/Text/JSON/Canonical/Types.hs --- old/canonical-json-0.6.0.0/Text/JSON/Canonical/Types.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/canonical-json-0.6.0.1/Text/JSON/Canonical/Types.hs 2001-09-09 03:46:40.000000000 +0200 @@ -26,7 +26,7 @@ #if !MIN_VERSION_base(4,8,0) import Data.Monoid (Monoid) #endif -#if MIN_VERSION_base(4,9,0) +#if (MIN_VERSION_base(4,9,0) && !MIN_VERSION_base(4,13,0)) import Data.Semigroup (Semigroup) #endif import Data.Typeable (Typeable) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/canonical-json-0.6.0.0/canonical-json.cabal new/canonical-json-0.6.0.1/canonical-json.cabal --- old/canonical-json-0.6.0.0/canonical-json.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/canonical-json-0.6.0.1/canonical-json.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: canonical-json -version: 0.6.0.0 +version: 0.6.0.1 synopsis: Canonical JSON for signing and hashing JSON values description: An implementation of Canonical JSON. . @@ -41,7 +41,7 @@ MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables, OverlappingInstances build-depends: base >= 4.5 && < 5, - bytestring >= 0.10.4 && < 0.11, + bytestring >= 0.10.4 && < 0.12, containers >= 0.4 && < 0.7, deepseq >= 1.2 && < 1.5, parsec >= 3.1 && < 3.2, @@ -57,10 +57,10 @@ bytestring, canonical-json, containers, - aeson == 1.4.*, + aeson >= 1.4 && < 2.2, vector, unordered-containers, - QuickCheck >= 2.11 && < 2.13, + QuickCheck >= 2.11 && < 2.16, tasty, tasty-quickcheck default-language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/canonical-json-0.6.0.0/tests/TestSuite.hs new/canonical-json-0.6.0.1/tests/TestSuite.hs --- old/canonical-json-0.6.0.0/tests/TestSuite.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/canonical-json-0.6.0.1/tests/TestSuite.hs 2001-09-09 03:46:40.000000000 +0200 @@ -14,10 +14,14 @@ #endif import qualified Data.Aeson as Aeson (Value (..), eitherDecode) +#if MIN_VERSION_aeson(2,0,0) +import qualified Data.Aeson.KeyMap as KeyMap (fromList) +#else +import qualified Data.HashMap.Strict as KeyMap (fromList) +#endif import Data.String (IsString, fromString) import qualified Data.Map as Map import qualified Data.Vector as V (fromList) -import qualified Data.HashMap.Strict as HM (fromList) import Test.QuickCheck import Test.Tasty.QuickCheck (testProperty) @@ -63,7 +67,9 @@ fmap canonicalise (parseCanonicalJSON (BS.pack (prettyCanonicalJSON jsval))) prop_aeson_canonical jsval = - Aeson.eitherDecode (renderCanonicalJSON jsval) == Right (toAeson jsval) + Aeson.eitherDecode (renderCanonicalJSON jsval') == Right (toAeson jsval') + where + jsval' = omitNonPrintableChars jsval prop_toJSON_fromJSON :: (Monad m, ToJSON m a, FromJSON m a, Eq a) => a -> m Bool prop_toJSON_fromJSON x = @@ -117,12 +123,43 @@ toAeson (JSNum n) = Aeson.Number (fromIntegral n) toAeson (JSString s) = Aeson.String (toAesonStr s) toAeson (JSArray xs) = Aeson.Array $ V.fromList [ toAeson x | x <- xs ] -toAeson (JSObject xs) = Aeson.Object $ HM.fromList [ (toAesonStr k, toAeson v) - | (k, v) <- xs ] +toAeson (JSObject xs) = Aeson.Object $ KeyMap.fromList [ (toAesonStr k, toAeson v) + | (k, v) <- xs ] toAesonStr :: IsString s => JSString -> s toAesonStr = fromString . fromJSString +-- | As discussed in the haddock docs for 'renderCanonicalJSON', Canonical +-- JSON is /not/ a proper subset of RFC 7159. +-- +-- So for the property 'prop_aeson_canonical', where we check that everything +-- produced as canoncal JSON can be parsed by Aeson (which we assume correctly +-- implements RFC 7159), we have to tweak things to keep us within the common +-- subset of canoncal JSON and RFC 7159. Specifically, canoncal JSON only +-- escapes \ and ", and does not escape any other non-printable characters. +-- +-- So the tweak is to just omit non-printable characters from all strings. +-- +omitNonPrintableChars :: JSValue -> JSValue +omitNonPrintableChars = omitJSValue + where + omitJSValue v@JSNull = v + omitJSValue v@(JSBool _) = v + omitJSValue v@(JSNum _) = v + omitJSValue (JSString s) = JSString (omitJSString s) + omitJSValue (JSArray vs) = JSArray [ omitJSValue v | v <- vs] + omitJSValue (JSObject vs) = JSObject $ omitDupKeys + [ (omitJSString k, omitJSValue v) + | (k,v) <- vs ] + + omitDupKeys :: [(JSString, JSValue)] -> [(JSString, JSValue)] + omitDupKeys = nubBy (\a b -> fst a == fst b) + + omitJSString :: JSString -> JSString + omitJSString = toJSString + . filter (\c -> c >= ' ') + . fromJSString + instance Arbitrary JSValue where arbitrary = sized $ \sz -> @@ -161,5 +198,6 @@ instance Arbitrary JSString where arbitrary = toJSString . getASCIIString <$> arbitrary - shrink s = [ toJSString s' | s' <- shrink (fromJSString s) ] + shrink s = [ toJSString s' | s' <- shrink (fromJSString s) + , all (\c -> c >= ' ') s' ]
