Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package dhall-json for openSUSE:Factory checked in at 2022-02-11 23:08:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dhall-json (Old) and /work/SRC/openSUSE:Factory/.dhall-json.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dhall-json" Fri Feb 11 23:08:28 2022 rev:11 rq:953427 version:1.7.9 Changes: -------- --- /work/SRC/openSUSE:Factory/dhall-json/dhall-json.changes 2021-09-10 23:41:02.290541950 +0200 +++ /work/SRC/openSUSE:Factory/.dhall-json.new.1956/dhall-json.changes 2022-02-11 23:10:26.303124518 +0100 @@ -1,0 +2,8 @@ +Thu Feb 3 03:29:24 UTC 2022 - Peter Simons <[email protected]> + +- Update dhall-json to version 1.7.9 revision 2. + 1.7.9 + + * [Build against `aeson-2.0`](https://github.com/dhall-lang/dhall-haskell/pull/2315) + +------------------------------------------------------------------- Old: ---- dhall-json-1.7.8.tar.gz New: ---- dhall-json-1.7.9.tar.gz dhall-json.cabal ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dhall-json.spec ++++++ --- /var/tmp/diff_new_pack.KipgxK/_old 2022-02-11 23:10:26.743125791 +0100 +++ /var/tmp/diff_new_pack.KipgxK/_new 2022-02-11 23:10:26.751125813 +0100 @@ -1,7 +1,7 @@ # # spec file for package dhall-json # -# Copyright (c) 2021 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,12 +19,13 @@ %global pkg_name dhall-json %bcond_with tests Name: %{pkg_name} -Version: 1.7.8 +Version: 1.7.9 Release: 0 Summary: Convert between Dhall and JSON or YAML License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{name} Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz +Source1: https://hackage.haskell.org/package/%{name}-%{version}/revision/2.cabal#/%{name}.cabal BuildRequires: chrpath BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel @@ -83,6 +84,7 @@ %prep %autosetup +cp -p %{SOURCE1} %{name}.cabal %build %ghc_lib_build ++++++ dhall-json-1.7.8.tar.gz -> dhall-json-1.7.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/CHANGELOG.md new/dhall-json-1.7.9/CHANGELOG.md --- old/dhall-json-1.7.8/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,7 @@ +1.7.9 + +* [Build against `aeson-2.0`](https://github.com/dhall-lang/dhall-haskell/pull/2315) + 1.7.8 * [Add support for `Date` / `Time` / `TimeZone`](https://github.com/dhall-lang/dhall-haskell/pull/2247) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/dhall-json.cabal new/dhall-json-1.7.9/dhall-json.cabal --- old/dhall-json-1.7.8/dhall-json.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/dhall-json.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ Name: dhall-json -Version: 1.7.8 +Version: 1.7.9 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 @@ -38,7 +38,7 @@ Hs-Source-Dirs: src Build-Depends: base >= 4.11.0.0 && < 5 , - aeson >= 1.4.6.0 && < 1.6 , + aeson >= 1.4.6.0 && < 2.1 , aeson-pretty < 0.9 , aeson-yaml >= 1.1.0 && < 1.2 , bytestring < 0.12, @@ -48,7 +48,7 @@ filepath < 1.5 , lens-family-core >= 1.0.0 && < 2.2 , optparse-applicative >= 0.14.0.0 && < 0.17, - prettyprinter >= 1.5.1 && < 1.8 , + prettyprinter >= 1.7.0 && < 1.8 , scientific >= 0.3.0.0 && < 0.4 , text >= 0.11.1.0 && < 1.3 , unordered-containers < 0.3 , @@ -59,6 +59,7 @@ Dhall.JSON.Yaml Dhall.DhallToYaml.Main Other-Modules: + Dhall.JSON.Compat Dhall.JSON.Util GHC-Options: -Wall Default-Language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/json-to-dhall/Main.hs new/dhall-json-1.7.9/json-to-dhall/Main.hs --- old/dhall-json-1.7.8/json-to-dhall/Main.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/json-to-dhall/Main.hs 2001-09-09 03:46:40.000000000 +0200 @@ -15,15 +15,15 @@ import Options.Applicative (Parser, ParserInfo) import qualified Control.Exception -import qualified Data.Aeson as Aeson -import qualified Data.ByteString.Lazy.Char8 as ByteString +import qualified Data.Aeson as Aeson +import qualified Data.ByteString.Lazy.Char8 as ByteString import qualified Dhall.Core import qualified Dhall.Util import qualified GHC.IO.Encoding -import qualified Options.Applicative as Options -import qualified Paths_dhall_json as Meta +import qualified Options.Applicative as Options +import qualified Paths_dhall_json as Meta import qualified System.Exit -import qualified System.IO as IO +import qualified System.IO as IO -- --------------- -- Command options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/src/Dhall/JSON/Compat.hs new/dhall-json-1.7.9/src/Dhall/JSON/Compat.hs --- old/dhall-json-1.7.8/src/Dhall/JSON/Compat.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/dhall-json-1.7.9/src/Dhall/JSON/Compat.hs 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,79 @@ +{-# LANGUAGE CPP #-} + +-- | Compatibility helpers for the @aeson-2@ migration. +module Dhall.JSON.Compat ( + objectFromList + , mapToAscList + , filterObject + , lookupObject + , traverseObjectWithKey + , objectKeys + , textToKey + ) where + +import Data.Aeson (Object, Value) +import Data.Text (Text) + +#if MIN_VERSION_aeson(2,0,0) +import Data.Aeson.Key (Key) +import qualified Data.Aeson.Key as Key +import Data.Aeson.KeyMap (KeyMap) +import qualified Data.Aeson.KeyMap as KeyMap +import Data.Bifunctor (first) +#else +import Data.HashMap.Strict (HashMap) +import qualified Data.HashMap.Strict as HashMap +import qualified Data.List as List +#endif + +objectFromList :: [(Text, Value)] -> Object +#if MIN_VERSION_aeson(2,0,0) +objectFromList = KeyMap.fromList . map (first Key.fromText) +#else +objectFromList = HashMap.fromList +#endif + +filterObject :: (Value -> Bool) -> Object -> Object +#if MIN_VERSION_aeson(2,0,0) +filterObject = KeyMap.filter +#else +filterObject = HashMap.filter +#endif + +#if MIN_VERSION_aeson(2,0,0) +mapToAscList :: KeyMap a -> [(Text, a)] +mapToAscList = map (first Key.toText) . KeyMap.toAscList +#else +mapToAscList :: HashMap Text a -> [(Text, a)] +mapToAscList = List.sortOn fst . HashMap.toList +#endif + +lookupObject :: Text -> Object -> Maybe Value +#if MIN_VERSION_aeson(2,0,0) +lookupObject k = KeyMap.lookup (Key.fromText k) +#else +lookupObject = HashMap.lookup +#endif + +objectKeys :: Object -> [Text] +#if MIN_VERSION_aeson(2,0,0) +objectKeys = map (Key.toText) . KeyMap.keys +#else +objectKeys = HashMap.keys +#endif + +#if MIN_VERSION_aeson(2,0,0) +textToKey :: Text -> Key +textToKey = Key.fromText +#else +textToKey :: Text -> Text +textToKey = id +#endif + +#if MIN_VERSION_aeson(2,0,0) +traverseObjectWithKey :: Applicative f => (Key -> v1 -> f v2) -> KeyMap v1 -> f (KeyMap v2) +traverseObjectWithKey = KeyMap.traverseWithKey +#else +traverseObjectWithKey :: Applicative f => (Text -> v1 -> f v2) -> HashMap Text v1 -> f (HashMap Text v2) +traverseObjectWithKey = HashMap.traverseWithKey +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/src/Dhall/JSON.hs new/dhall-json-1.7.9/src/Dhall/JSON.hs --- old/dhall-json-1.7.8/src/Dhall/JSON.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/src/Dhall/JSON.hs 2001-09-09 03:46:40.000000000 +0200 @@ -213,40 +213,40 @@ , CompileError(..) ) where -import Control.Applicative (empty, (<|>)) -import Control.Exception (Exception, throwIO) -import Control.Monad (guard) -import Data.Aeson (ToJSON (..), Value (..)) -import Data.Maybe (fromMaybe) -import Data.Text (Text) -import Data.Text.Prettyprint.Doc (Pretty) -import Data.Void (Void) -import Dhall.Core (Binding (..), DhallDouble (..), Expr) -import Dhall.Import (SemanticCacheMode (..)) -import Dhall.JSON.Util (pattern FA, pattern V) -import Dhall.Map (Map) -import Options.Applicative (Parser) -import Prelude hiding (getContents) - -import qualified Data.Aeson as Aeson -import qualified Data.Foldable as Foldable -import qualified Data.HashMap.Strict as HashMap +import Control.Applicative (empty, (<|>)) +import Control.Exception (Exception, throwIO) +import Control.Monad (guard) +import Data.Aeson (ToJSON (..), Value (..)) +import Data.Maybe (fromMaybe) +import Data.Text (Text) +import Data.Void (Void) +import Dhall.Core (Binding (..), DhallDouble (..), Expr) +import Dhall.Import (SemanticCacheMode (..)) +import Dhall.JSON.Util (pattern FA, pattern V) +import Dhall.Map (Map) +import Options.Applicative (Parser) +import Prelude hiding (getContents) +import Prettyprinter (Pretty) + +import qualified Data.Aeson as Aeson +import qualified Data.Foldable as Foldable import qualified Data.List import qualified Data.Map import qualified Data.Ord import qualified Data.Text -import qualified Data.Text.Prettyprint.Doc.Render.Text as Pretty -import qualified Data.Vector as Vector -import qualified Dhall.Core as Core +import qualified Data.Vector as Vector +import qualified Dhall.Core as Core import qualified Dhall.Import +import qualified Dhall.JSON.Compat as JSON.Compat import qualified Dhall.Map import qualified Dhall.Optics import qualified Dhall.Parser import qualified Dhall.Pretty import qualified Dhall.TypeCheck import qualified Dhall.Util -import qualified Lens.Family as Lens +import qualified Lens.Family as Lens import qualified Options.Applicative +import qualified Prettyprinter.Render.Text as Pretty import qualified System.FilePath {-| This is the exception type for errors that might arise when translating @@ -536,7 +536,7 @@ ys <- traverse inner (Foldable.toList xs) - return (Aeson.Object (HashMap.fromList ys)) + return (Aeson.Object (JSON.Compat.objectFromList ys)) outer (Core.App (Core.Field (V 0) (FA "number")) (Core.DoubleLit (DhallDouble n))) = return (Aeson.toJSON n) outer (Core.App (Core.Field (V 0) (FA "string")) (Core.TextLit (Core.Chunks [] text))) = @@ -581,7 +581,7 @@ ys <- traverse inner (Foldable.toList xs) - return (Aeson.Object (HashMap.fromList ys)) + return (Aeson.Object (JSON.Compat.objectFromList ys)) outer (Core.App (Core.Field (V 0) (FA "double")) (Core.DoubleLit (DhallDouble n))) = return (Aeson.toJSON n) outer (Core.App (Core.Field (V 0) (FA "integer")) (Core.IntegerLit n)) = @@ -635,7 +635,7 @@ omitNull :: Value -> Value omitNull (Object object) = Object fields where - fields =HashMap.filter (/= Null) (fmap omitNull object) + fields = JSON.Compat.filterObject (/= Null) (fmap omitNull object) omitNull (Array array) = Array (fmap omitNull array) omitNull (String string) = @@ -654,7 +654,7 @@ omitEmpty (Object object) = if null fields then Null else Object fields where - fields = HashMap.filter (/= Null) (fmap omitEmpty object) + fields = JSON.Compat.filterObject (/= Null) (fmap omitEmpty object) omitEmpty (Array array) = if null elems then Null else Array elems where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/src/Dhall/JSONToDhall.hs new/dhall-json-1.7.9/src/Dhall/JSONToDhall.hs --- old/dhall-json-1.7.8/src/Dhall/JSONToDhall.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/src/Dhall/JSONToDhall.hs 2001-09-09 03:46:40.000000000 +0200 @@ -381,17 +381,15 @@ import qualified Data.Aeson.Types as Aeson.Types import qualified Data.ByteString.Lazy.Char8 as BSL8 import qualified Data.Foldable as Foldable -import qualified Data.HashMap.Strict as HM -import qualified Data.List as List import qualified Data.Map import qualified Data.Map.Merge.Lazy as Data.Map.Merge -import qualified Data.Ord as Ord import qualified Data.Sequence as Seq import qualified Data.String import qualified Data.Text as Text import qualified Data.Vector as Vector import qualified Dhall.Core as D import qualified Dhall.Import +import qualified Dhall.JSON.Compat as JSON.Compat import qualified Dhall.Lint as Lint import qualified Dhall.Map as Map import qualified Dhall.Optics as Optics @@ -519,8 +517,8 @@ keyValMay :: Value -> Maybe (Text, Value) keyValMay (Aeson.Object o) = do - Aeson.String k <- HM.lookup "key" o - v <- HM.lookup "value" o + Aeson.String k <- JSON.Compat.lookupObject "key" o + v <- JSON.Compat.lookupObject "value" o return (k, v) keyValMay _ = Nothing @@ -532,7 +530,7 @@ -} inferSchema :: Value -> Schema inferSchema (Aeson.Object m) = - let convertMap = Data.Map.fromList . HM.toList + let convertMap = Data.Map.fromDistinctAscList . JSON.Compat.mapToAscList in (Record . RecordSchema . convertMap) (fmap inferSchema m) inferSchema (Aeson.Array xs) = @@ -832,13 +830,13 @@ -- object ~> Record loop jsonPath (D.Record r) v@(Aeson.Object o) - | extraKeys <- HM.keys o \\ Map.keys r + | extraKeys <- JSON.Compat.objectKeys o \\ Map.keys r , strictRecs && not (null extraKeys) = Left (UnhandledKeys extraKeys (D.Record r) v jsonPath) | otherwise = let f :: Text -> ExprX -> Either CompileError ExprX - f k t | Just value <- HM.lookup k o - = loop (Aeson.Types.Key k : jsonPath) t value + f k t | Just value <- JSON.Compat.lookupObject k o + = loop (Aeson.Types.Key (JSON.Compat.textToKey k) : jsonPath) t value | App D.Optional t' <- t = Right (App D.None t') | App D.List _ <- t @@ -853,7 +851,7 @@ | not noKeyValArr , os :: [Value] <- toList a , Just kvs <- traverse keyValMay os - = loop jsonPath t (Aeson.Object $ HM.fromList kvs) + = loop jsonPath t (Aeson.Object $ JSON.Compat.objectFromList kvs) | noKeyValArr = Left (NoKeyValArray t v) | otherwise @@ -866,7 +864,7 @@ , Just mapKey <- D.recordFieldValue <$> Map.lookup "mapKey" r , Just mapValue <- D.recordFieldValue <$> Map.lookup "mapValue" r = do - keyExprMap <- HM.traverseWithKey (\k child -> loop (Aeson.Types.Key k : jsonPath) mapValue child) o + keyExprMap <- JSON.Compat.traverseObjectWithKey (\k child -> loop (Aeson.Types.Key k : jsonPath) mapValue child) o toKey <- case mapKey of @@ -881,9 +879,9 @@ ] let records = - (fmap f . Seq.fromList . List.sort . HM.toList) keyExprMap + (fmap f . Seq.fromList . JSON.Compat.mapToAscList) keyExprMap - let typeAnn = if HM.null o then Just t else Nothing + let typeAnn = if null o then Just t else Nothing return (D.ListLit typeAnn records) | noKeyValMap @@ -972,10 +970,7 @@ elements = Seq.fromList (fmap inner - (List.sortBy - (Ord.comparing fst) - (HM.toList o) - ) + (JSON.Compat.mapToAscList o) ) elementType @@ -1061,10 +1056,7 @@ elements = Seq.fromList (fmap inner - (List.sortBy - (Ord.comparing fst) - (HM.toList o) - ) + (JSON.Compat.mapToAscList o) ) elementType diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dhall-json-1.7.8/tasty/Main.hs new/dhall-json-1.7.9/tasty/Main.hs --- old/dhall-json-1.7.8/tasty/Main.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/dhall-json-1.7.9/tasty/Main.hs 2001-09-09 03:46:40.000000000 +0200 @@ -3,8 +3,8 @@ module Main where -import Data.Void (Void) -import Test.Tasty (TestTree) +import Data.Void (Void) +import Test.Tasty (TestTree) import qualified Data.Aeson as Aeson import qualified Data.ByteString.Lazy ++++++ dhall-json.cabal ++++++ Name: dhall-json Version: 1.7.9 x-revision: 2 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 License-File: LICENSE Copyright: 2017 Gabriel Gonzalez Author: Gabriel Gonzalez Maintainer: [email protected] Bug-Reports: https://github.com/dhall-lang/dhall-haskell/issues Synopsis: Convert between Dhall and JSON or YAML Description: Use this package if you want to convert between Dhall expressions and JSON or YAML. You can use this package as a library or an executable: . * See the "Dhall.JSON" or "Dhall.JSONToDhall" modules if you want to use this package as a library . * Use the @dhall-to-json@, @dhall-to-yaml@, or @json-to-dhall@ programs from this package if you want an executable . The "Dhall.JSON" and "Dhall.JSONToDhall" modules also contains instructions for how to use this package Category: Compiler Extra-Source-Files: CHANGELOG.md tasty/data/*.dhall tasty/data/*.json tasty/data/error/*.golden tasty/data/error/*.json tasty/data/error/*.dhall Source-Repository head Type: git Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-json Library Hs-Source-Dirs: src Build-Depends: base >= 4.11.0.0 && < 5 , aeson >= 1.4.6.0 && < 2.1 , aeson-pretty < 0.9 , aeson-yaml >= 1.1.0 && < 1.2 , bytestring < 0.12, containers >= 0.5.9 && < 0.7 , dhall >= 1.40.0 && < 1.41, exceptions >= 0.8.3 && < 0.11, filepath < 1.5 , lens-family-core >= 1.0.0 && < 2.2 , optparse-applicative >= 0.14.0.0 && < 0.18, prettyprinter >= 1.7.0 && < 1.8 , scientific >= 0.3.0.0 && < 0.4 , text >= 0.11.1.0 && < 2.1 , unordered-containers < 0.3 , vector Exposed-Modules: Dhall.JSON Dhall.JSONToDhall Dhall.JSON.Yaml Dhall.DhallToYaml.Main Other-Modules: Dhall.JSON.Compat Dhall.JSON.Util GHC-Options: -Wall Default-Language: Haskell2010 Executable dhall-to-json Hs-Source-Dirs: dhall-to-json Main-Is: Main.hs Build-Depends: base , aeson , aeson-pretty >= 0.8.5 && < 0.9 , bytestring , dhall , dhall-json , optparse-applicative , text Other-Modules: Paths_dhall_json GHC-Options: -Wall Default-Language: Haskell2010 Executable dhall-to-yaml Hs-Source-Dirs: dhall-to-yaml Main-Is: Main.hs Build-Depends: base , dhall-json Other-Modules: Paths_dhall_json GHC-Options: -Wall Default-Language: Haskell2010 Executable json-to-dhall Hs-Source-Dirs: json-to-dhall Main-Is: Main.hs Build-Depends: base , aeson , ansi-terminal >= 0.6.3.1 && < 0.12, bytestring , dhall , dhall-json , exceptions >= 0.8.3 && < 0.11, optparse-applicative , prettyprinter , prettyprinter-ansi-terminal >= 1.1.1 && < 1.2 , text Other-Modules: Paths_dhall_json GHC-Options: -Wall Default-Language: Haskell2010 Test-Suite tasty Type: exitcode-stdio-1.0 Hs-Source-Dirs: tasty Main-Is: Main.hs Build-Depends: base , aeson , bytestring , dhall , dhall-json , tasty < 1.5, text , tasty-hunit >= 0.2, tasty-silver >= 3.0 GHC-Options: -Wall Default-Language: Haskell2010
