Hello community, here is the log from the commit of package ghc-pem for openSUSE:Factory checked in at 2018-05-30 12:22:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-pem (Old) and /work/SRC/openSUSE:Factory/.ghc-pem.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-pem" Wed May 30 12:22:08 2018 rev:4 rq:610353 version:0.2.4 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-pem/ghc-pem.changes 2017-09-15 22:04:02.853914393 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-pem.new/ghc-pem.changes 2018-05-30 12:26:43.939464777 +0200 @@ -1,0 +2,6 @@ +Mon May 14 17:02:11 UTC 2018 - [email protected] + +- Update pem to version 0.2.4. + Upstream does not provide a changelog. + +------------------------------------------------------------------- Old: ---- pem-0.2.2.tar.gz New: ---- pem-0.2.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-pem.spec ++++++ --- /var/tmp/diff_new_pack.vhMIzV/_old 2018-05-30 12:26:44.783435927 +0200 +++ /var/tmp/diff_new_pack.vhMIzV/_new 2018-05-30 12:26:44.787435790 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-pem # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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 pem %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.2 +Version: 0.2.4 Release: 0 Summary: Privacy Enhanced Mail (PEM) format reader and writer License: BSD-3-Clause @@ -27,9 +27,9 @@ URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel -BuildRequires: ghc-base64-bytestring-devel +BuildRequires: ghc-basement-devel BuildRequires: ghc-bytestring-devel -BuildRequires: ghc-mtl-devel +BuildRequires: ghc-memory-devel BuildRequires: ghc-rpm-macros %if %{with tests} BuildRequires: ghc-HUnit-devel @@ -72,9 +72,7 @@ %ghc_pkg_recache %files -f %{name}.files -%doc LICENSE -%dir %{_datadir}/%{pkg_name}-%{version} -%{_datadir}/%{pkg_name}-%{version}/README.md +%license LICENSE %files devel -f %{name}-devel.files ++++++ pem-0.2.2.tar.gz -> pem-0.2.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/Data/PEM/Parser.hs new/pem-0.2.4/Data/PEM/Parser.hs --- old/pem-0.2.2/Data/PEM/Parser.hs 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/Data/PEM/Parser.hs 2018-02-27 08:16:47.000000000 +0100 @@ -11,7 +11,7 @@ -- A PEM contains contains from one to many PEM sections. -- Each section contains an optional key-value pair header -- and a binary content encoded in base64. --- +-- module Data.PEM.Parser ( pemParseBS , pemParseLBS @@ -22,9 +22,10 @@ import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as LC -import qualified Data.ByteString.Base64.Lazy as Base64 import Data.PEM.Types +import Data.ByteArray.Encoding (Base(Base64), convertFromBase) +import qualified Data.ByteArray as BA type Line = L.ByteString @@ -51,24 +52,24 @@ getPemHeaderLoop (r:rs) = -- FIXME doesn't properly parse headers yet Right ([], r:rs) + getPemContent :: String -> [(String,ByteString)] -> [BC.ByteString] -> [L.ByteString] -> Either (Maybe String) (PEM, [L.ByteString]) getPemContent name hdrs contentLines lbs = case lbs of [] -> Left $ Just "invalid PEM: no end marker found" (l:ls) -> case endMarker `prefixEat` l of Nothing -> - let content = Base64.decodeLenient l - in getPemContent name hdrs (content : contentLines) ls + case convertFromBase Base64 $ L.toStrict l of + Left err -> Left $ Just ("invalid PEM: decoding failed: " ++ err) + Right content -> getPemContent name hdrs (content : contentLines) ls Just n -> getPemName (finalizePem name hdrs contentLines) n ls finalizePem name hdrs contentLines nameEnd lbs | nameEnd /= name = Left $ Just "invalid PEM: end name doesn't match start name" | otherwise = let pem = PEM { pemName = name , pemHeader = hdrs - , pemContent = toSBS $ L.concat $ reverse contentLines } + , pemContent = BA.concat $ reverse contentLines } in Right (pem, lbs) - toSBS = BC.concat . L.toChunks - prefixEat prefix x = let (x1, x2) = L.splitAt (L.length prefix) x in if x1 == prefix then Just x2 else Nothing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/Data/PEM/Types.hs new/pem-0.2.4/Data/PEM/Types.hs --- old/pem-0.2.2/Data/PEM/Types.hs 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/Data/PEM/Types.hs 2018-03-02 14:07:23.000000000 +0100 @@ -8,13 +8,21 @@ module Data.PEM.Types where import Data.ByteString (ByteString) +import Basement.NormalForm -- | Represent one PEM section -- -- for now headers are not serialized at all. -- this is just available here as a placeholder for a later implementation. data PEM = PEM - { pemName :: String -- ^ the name of the section, found after the dash BEGIN tag. - , pemHeader :: [(String, ByteString)] -- ^ optionals key value pair header - , pemContent :: ByteString -- ^ binary content of the section - } deriving (Show,Eq) + { pemName :: String -- ^ the name of the section, found after the dash BEGIN tag. + , pemHeader :: [(String, ByteString)] -- ^ optionals key value pair header + , pemContent :: ByteString -- ^ binary content of the section + } deriving (Show,Eq) + +instance NormalForm PEM where + toNormalForm pem = + toNormalForm (pemName pem) `seq` nfLbs (pemHeader pem) `seq` pemContent pem `seq` () + where + nfLbs [] = () + nfLbs ((s,bs):l) = toNormalForm s `seq` bs `seq` nfLbs l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/Data/PEM/Writer.hs new/pem-0.2.4/Data/PEM/Writer.hs --- old/pem-0.2.2/Data/PEM/Writer.hs 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/Data/PEM/Writer.hs 2018-02-27 08:16:47.000000000 +0100 @@ -16,7 +16,7 @@ import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as L -import qualified Data.ByteString.Base64 as Base64 +import Data.ByteArray.Encoding (Base(Base64), convertToBase) -- | write a PEM structure to a builder pemWrite :: PEM -> L.ByteString @@ -33,7 +33,7 @@ toHeader (k,v) = [ BC.pack k, ":", v, "\n" ] -- expect only ASCII. need to find a type to represent it. sectionName = BC.pack $ pemName pem - encodeLine l = Base64.encode l `B.append` "\n" + encodeLine l = convertToBase Base64 l `B.append` "\n" splitChunks b | B.length b > 48 = let (x,y) = B.splitAt 48 b in x : splitChunks y diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/Data/PEM.hs new/pem-0.2.4/Data/PEM.hs --- old/pem-0.2.2/Data/PEM.hs 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/Data/PEM.hs 2018-02-27 08:16:47.000000000 +0100 @@ -8,10 +8,10 @@ -- Read and write PEM files -- module Data.PEM - ( module Data.PEM.Types + ( module Data.PEM.Types , module Data.PEM.Writer , module Data.PEM.Parser - ) where + ) where import Data.PEM.Types import Data.PEM.Writer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/LICENSE new/pem-0.2.4/LICENSE --- old/pem-0.2.2/LICENSE 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/LICENSE 2018-02-27 08:06:02.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2010-2012 Vincent Hanquez <[email protected]> +Copyright (c) 2010-2018 Vincent Hanquez <[email protected]> All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/README.md new/pem-0.2.4/README.md --- old/pem-0.2.2/README.md 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -PEM haskell library -=================== - -Handle Privacy Enhanced Message (PEM) format. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pem-0.2.2/pem.cabal new/pem-0.2.4/pem.cabal --- old/pem-0.2.2/pem.cabal 2014-04-16 21:59:23.000000000 +0200 +++ new/pem-0.2.4/pem.cabal 2018-03-02 15:32:59.000000000 +0100 @@ -1,25 +1,24 @@ Name: pem -Version: 0.2.2 -Description: Privacy Enhanced Mail (PEM) format reader and writer. +Version: 0.2.4 +Synopsis: Privacy Enhanced Mail (PEM) format reader and writer. +Description: Privacy Enhanced Mail (PEM) format reader and writer. long description License: BSD3 License-file: LICENSE Copyright: Vincent Hanquez <[email protected]> Author: Vincent Hanquez <[email protected]> Maintainer: Vincent Hanquez <[email protected]> -Synopsis: Privacy Enhanced Mail (PEM) format reader and writer. Build-Type: Simple Category: Data stability: experimental Cabal-Version: >=1.8 Homepage: http://github.com/vincenthz/hs-pem -data-files: README.md extra-source-files: Tests/pem.hs Library Build-Depends: base >= 3 && < 5 - , mtl , bytestring - , base64-bytestring >= 1.0.0 + , basement + , memory Exposed-modules: Data.PEM Other-modules: Data.PEM.Parser Data.PEM.Writer
