Hello community, here is the log from the commit of package ghc-memory for openSUSE:Factory checked in at 2017-03-14 10:05:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-memory (Old) and /work/SRC/openSUSE:Factory/.ghc-memory.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-memory" Tue Mar 14 10:05:30 2017 rev:6 rq:461657 version:0.14.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-memory/ghc-memory.changes 2016-07-20 09:23:51.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-memory.new/ghc-memory.changes 2017-03-14 10:05:31.221099765 +0100 @@ -1,0 +2,5 @@ +Sun Feb 12 14:18:25 UTC 2017 - psim...@suse.com + +- Update to version 0.14.1 with cabal2obs. + +------------------------------------------------------------------- Old: ---- memory-0.13.tar.gz New: ---- memory-0.14.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-memory.spec ++++++ --- /var/tmp/diff_new_pack.qNmQ2Z/_old 2017-03-14 10:05:31.901003491 +0100 +++ /var/tmp/diff_new_pack.qNmQ2Z/_new 2017-03-14 10:05:31.905002925 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-memory # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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,15 +19,14 @@ %global pkg_name memory %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.13 +Version: 0.14.1 Release: 0 Summary: Memory and related abstraction stuff License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other 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 -# Begin cabal-rpm deps: BuildRequires: ghc-bytestring-devel BuildRequires: ghc-deepseq-devel BuildRequires: ghc-rpm-macros @@ -37,7 +36,6 @@ BuildRequires: ghc-tasty-hunit-devel BuildRequires: ghc-tasty-quickcheck-devel %endif -# End cabal-rpm deps %description Chunk of memory, polymorphic byte array management and manipulation @@ -69,20 +67,14 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install - %check -%if %{with tests} -%{cabal} test -%endif - +%cabal_test %post devel %ghc_pkg_recache ++++++ memory-0.13.tar.gz -> memory-0.14.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/CHANGELOG.md new/memory-0.14.1/CHANGELOG.md --- old/memory-0.13/CHANGELOG.md 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/CHANGELOG.md 2017-01-16 11:24:02.000000000 +0100 @@ -1,3 +1,16 @@ +## 0.14.1 + +* Fix `Show` instance of Bytes (Oliver Chéron) + +## 0.14 + +* Improve fromW64BE +* Add IsString instance for ScrubbedBytes + +## 0.13 + +* Add combinator to check for end of parsing. + ## 0.12 * Fix compilation with mkWeak and latest GHC (Lars Kuhtz) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/Data/ByteArray/Bytes.hs new/memory-0.14.1/Data/ByteArray/Bytes.hs --- old/memory-0.13/Data/ByteArray/Bytes.hs 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/Data/ByteArray/Bytes.hs 2017-01-16 11:16:10.000000000 +0100 @@ -154,7 +154,7 @@ chunkLoop idx | booleanPrim (len ==# idx) = [] | booleanPrim ((len -# idx) ># 63#) = - bytesLoop idx (idx +# 64#) (chunkLoop (idx +# 64#)) + bytesLoop idx 64# (chunkLoop (idx +# 64#)) | otherwise = bytesLoop idx (len -# idx) xs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/Data/ByteArray/Parse.hs new/memory-0.14.1/Data/ByteArray/Parse.hs --- old/memory-0.13/Data/ByteArray/Parse.hs 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/Data/ByteArray/Parse.hs 2016-05-22 17:32:26.000000000 +0200 @@ -174,7 +174,7 @@ case B.uncons buf of Nothing -> runParser (getMore >> byte w) buf err ok Just (c1,b2) | c1 == w -> ok b2 () - | otherwise -> err buf ("byte " ++ show w ++ " : failed") + | otherwise -> err buf ("byte " ++ show w ++ " : failed : got " ++ show c1) -- | Parse a sequence of bytes from current position -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/Data/ByteArray/ScrubbedBytes.hs new/memory-0.14.1/Data/ByteArray/ScrubbedBytes.hs --- old/memory-0.13/Data/ByteArray/ScrubbedBytes.hs 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/Data/ByteArray/ScrubbedBytes.hs 2016-12-17 11:24:07.000000000 +0100 @@ -17,12 +17,14 @@ import GHC.Prim import GHC.Ptr import Data.Monoid +import Data.String (IsString(..)) import Data.Memory.PtrMethods (memCopy, memConstEqual) import Data.Memory.Internal.CompatPrim import Data.Memory.Internal.Compat (unsafeDoIO) import Data.Memory.Internal.Imports import Data.Memory.Internal.Scrubber (getScrubber) import Data.ByteArray.Types +import Foreign.Storable -- | ScrubbedBytes is a memory chunk which have the properties of: -- @@ -47,6 +49,8 @@ mconcat = unsafeDoIO . scrubbedBytesConcat instance NFData ScrubbedBytes where rnf b = b `seq` () +instance IsString ScrubbedBytes where + fromString = scrubbedFromChar8 instance ByteArrayAccess ScrubbedBytes where length = sizeofScrubbedBytes @@ -163,3 +167,11 @@ then loop (i +# 1#) s3 else if booleanPrim (ltWord# e1 e2) then (# s3, LT #) else (# s3, GT #) + +scrubbedFromChar8 :: [Char] -> ScrubbedBytes +scrubbedFromChar8 l = unsafeDoIO $ scrubbedBytesAlloc len (fill l) + where + len = Prelude.length l + fill :: [Char] -> Ptr Word8 -> IO () + fill [] _ = return () + fill (x:xs) !p = poke p (fromIntegral $ fromEnum x) >> fill xs (p `plusPtr` 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/memory.cabal new/memory-0.14.1/memory.cabal --- old/memory-0.13/memory.cabal 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/memory.cabal 2017-01-16 11:22:48.000000000 +0100 @@ -1,5 +1,5 @@ Name: memory -Version: 0.13 +Version: 0.14.1 Synopsis: memory and related abstraction stuff Description: Chunk of memory, polymorphic byte array management and manipulation @@ -88,7 +88,7 @@ Build-depends: bytestring if flag(support_deepseq) CPP-options: -DWITH_DEEPSEQ_SUPPORT - Build-depends: deepseq + Build-depends: deepseq >= 1.1 ghc-options: -Wall -fwarn-tabs default-language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/memory-0.13/tests/Tests.hs new/memory-0.14.1/tests/Tests.hs --- old/memory-0.13/tests/Tests.hs 2016-05-22 10:29:35.000000000 +0200 +++ new/memory-0.14.1/tests/Tests.hs 2017-01-16 11:16:10.000000000 +0100 @@ -4,6 +4,7 @@ import Imports import Utils +import Data.Char (chr) import Data.Word import Data.ByteArray (Bytes, ScrubbedBytes, ByteArray) import qualified Data.ByteArray as B @@ -52,6 +53,19 @@ , testGroup "ScrubbedBytes" (l withScrubbedBytesWitness) ] +testShowProperty :: Testable a + => String + -> (forall ba . (Show ba, Eq ba, ByteArray ba) => (ba -> ba) -> ([Word8] -> String) -> a) + -> TestTree +testShowProperty x p = + testGroup x + [ testProperty "Bytes" (p withBytesWitness showLikeString) + , testProperty "ScrubbedBytes" (p withScrubbedBytesWitness showLikeEmptySB) + ] + where + showLikeString l = show $ map (chr . fromIntegral) l + showLikeEmptySB _ = show (withScrubbedBytesWitness B.empty) + base64Kats = [ ("pleasure.", "cGxlYXN1cmUu") , ("leasure.", "bGVhc3VyZS4=") @@ -145,6 +159,8 @@ , testGroupBackends "hashing" $ \witnessID -> [ testGroup "SipHash" $ SipHash.tests witnessID ] + , testShowProperty "showing" $ \witnessID expectedShow (Words8 l) -> + (show . witnessID . B.pack $ l) == expectedShow l ] where basicProperties witnessID =