Hello community,

here is the log from the commit of package ghc-http-link-header for 
openSUSE:Factory checked in at 2017-04-25 08:58:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-link-header (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-http-link-header.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-http-link-header"

Tue Apr 25 08:58:54 2017 rev:2 rq:490239 version:1.0.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-http-link-header/ghc-http-link-header.changes    
    2017-04-17 10:24:58.745533845 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-http-link-header.new/ghc-http-link-header.changes
   2017-04-25 08:58:54.696952378 +0200
@@ -1,0 +2,10 @@
+Tue Nov 22 16:06:42 UTC 2016 - [email protected]
+
+- Update to version 1.0.3 with cabal2obs.
+
+-------------------------------------------------------------------
+Thu Sep 15 06:58:34 UTC 2016 - [email protected]
+
+- Update to version 1.0.2 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  http-link-header-1.0.1.tar.gz

New:
----
  http-link-header-1.0.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-http-link-header.spec ++++++
--- /var/tmp/diff_new_pack.KFUrZp/_old  2017-04-25 08:58:56.848648133 +0200
+++ /var/tmp/diff_new_pack.KFUrZp/_new  2017-04-25 08:58:56.852647567 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-http-link-header
 #
-# 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,19 +19,19 @@
 %global pkg_name http-link-header
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.0.1
+Version:        1.0.3
 Release:        0
 Summary:        A parser and writer for the HTTP Link header as specified in 
RFC 5988 "Web Linking"
 License:        SUSE-Public-Domain
-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-attoparsec-devel
 BuildRequires:  ghc-bytestring-conversion-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-errors-devel
+BuildRequires:  ghc-http-api-data-devel
 BuildRequires:  ghc-network-uri-devel
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
@@ -41,7 +41,6 @@
 BuildRequires:  ghc-hspec-attoparsec-devel
 BuildRequires:  ghc-hspec-devel
 %endif
-# End cabal-rpm deps
 
 %description
 Https://github.com/myfreeweb/http-link-header.
@@ -63,20 +62,14 @@
 echo > Setup.hs 'import Distribution.Simple'
 echo >>Setup.hs 'main = defaultMain'
 
-
 %build
 %ghc_lib_build
 
-
 %install
 %ghc_lib_install
 
-
 %check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
 
 %post devel
 %ghc_pkg_recache

++++++ http-link-header-1.0.1.tar.gz -> http-link-header-1.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-link-header-1.0.1/Setup.hs 
new/http-link-header-1.0.3/Setup.hs
--- old/http-link-header-1.0.1/Setup.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/http-link-header-1.0.3/Setup.hs 2016-09-05 13:06:32.000000000 +0200
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-link-header-1.0.1/benchmark/ParserBench.hs 
new/http-link-header-1.0.3/benchmark/ParserBench.hs
--- old/http-link-header-1.0.1/benchmark/ParserBench.hs 1970-01-01 
01:00:00.000000000 +0100
+++ new/http-link-header-1.0.3/benchmark/ParserBench.hs 2015-12-27 
20:29:33.000000000 +0100
@@ -0,0 +1,12 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module ParserBench (benchmarks) where
+
+import           Criterion
+import           Network.HTTP.Link.Parser
+
+benchmarks :: [Benchmark]
+benchmarks = [
+    bench "minimal" $ whnf parseLinkHeader "<http://example.com>; rel=\"next\""
+  , bench "large" $ whnf parseLinkHeader "\n\t <  http://example.com>; 
rel=next; title=\"Hello world\",  <ftp://hello.world>; rev=license; 
someWeirdParam=\"YOLO LOL\", <https://long.ass.domain.name.just.because/lol>; 
rel=\"something something something http://some.thing/lol/rel\"; "
+  ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-link-header-1.0.1/benchmark/WriterBench.hs 
new/http-link-header-1.0.3/benchmark/WriterBench.hs
--- old/http-link-header-1.0.1/benchmark/WriterBench.hs 1970-01-01 
01:00:00.000000000 +0100
+++ new/http-link-header-1.0.3/benchmark/WriterBench.hs 2015-12-27 
20:29:33.000000000 +0100
@@ -0,0 +1,28 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module WriterBench (benchmarks) where
+
+import           Criterion
+import           Data.String              (IsString (..))
+import           Network.HTTP.Link.Types
+import           Network.HTTP.Link.Writer
+import           Network.URI
+
+instance IsString URI where
+    fromString str = case parseURI str of
+        Just uri -> uri
+        Nothing -> error $ "Failed to parse URI: " ++ str
+
+benchmarks :: [Benchmark]
+benchmarks = [
+    bench "minimal" $ whnf writeLinkHeader
+        [ Link "http://example.com/thing"; [ (Rel, "next") ] ]
+  , bench "large" $ whnf writeLinkHeader
+        [ Link "http://example.com/something_long";
+               [ (Rel, "next prev http://hello.world/undefined";)
+               , (Title, "this is a test benchmark thingy")
+               ]
+        , Link "https://use.tls.everywhere.pls";
+               [ (Rel, "license")
+               , (Rev, "author") ]]
+  ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-link-header-1.0.1/http-link-header.cabal 
new/http-link-header-1.0.3/http-link-header.cabal
--- old/http-link-header-1.0.1/http-link-header.cabal   2015-08-23 
22:23:57.000000000 +0200
+++ new/http-link-header-1.0.3/http-link-header.cabal   2016-11-14 
12:27:58.000000000 +0100
@@ -1,11 +1,11 @@
 name:            http-link-header
-version:         1.0.1
+version:         1.0.3
 synopsis:        A parser and writer for the HTTP Link header as specified in 
RFC 5988 "Web Linking".
 description:     https://github.com/myfreeweb/http-link-header
 category:        Web
 homepage:        https://github.com/myfreeweb/http-link-header
 author:          Greg V
-copyright:       2014-2015 Greg V <[email protected]>
+copyright:       2014-2016 Greg V <[email protected]>
 maintainer:      [email protected]
 license:         PublicDomain
 license-file:    UNLICENSE
@@ -14,7 +14,7 @@
 extra-source-files:
     README.md
 tested-with:
-    GHC == 7.10.2
+    GHC == 8.0.1
 
 source-repository head
     type: git
@@ -27,6 +27,7 @@
       , bytestring
       , errors
       , network-uri
+      , http-api-data
       , attoparsec
       , bytestring-conversion
     default-language: Haskell2010
@@ -35,7 +36,6 @@
         Network.HTTP.Link.Types
         Network.HTTP.Link.Parser
         Network.HTTP.Link.Writer
-    ghc-prof-options: -prof
     ghc-options: -Wall
     hs-source-dirs: library
 
@@ -49,12 +49,12 @@
       , hspec-attoparsec
     default-language: Haskell2010
     ghc-options: -threaded -fhpc -Wall
-    ghc-prof-options: -auto-all -prof
     hs-source-dirs: test-suite
     main-is: Spec.hs
     other-modules:
         Network.HTTP.Link.ParserSpec
         Network.HTTP.Link.WriterSpec
+        Network.HTTP.LinkSpec
     type: exitcode-stdio-1.0
 
 benchmark benchmarks
@@ -63,9 +63,12 @@
       , text
       , http-link-header
       , directory
+      , network-uri
       , transformers
       , criterion
     default-language: Haskell2010
     hs-source-dirs: benchmark
     main-is: Bench.hs
+    other-modules: ParserBench
+                   WriterBench
     type: exitcode-stdio-1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-link-header-1.0.1/library/Network/HTTP/Link/Parser.hs 
new/http-link-header-1.0.3/library/Network/HTTP/Link/Parser.hs
--- old/http-link-header-1.0.1/library/Network/HTTP/Link/Parser.hs      
2015-08-23 22:06:23.000000000 +0200
+++ new/http-link-header-1.0.3/library/Network/HTTP/Link/Parser.hs      
2015-12-27 20:29:33.000000000 +0100
@@ -20,7 +20,7 @@
 import           Data.Text.Encoding (decodeUtf8)
 import           Data.ByteString (ByteString)
 import           Data.Char (isSpace)
-#if __GLASGOW_HASKELL__ < 709
+#if !MIN_VERSION_base(4,8,0)
 import           Data.Monoid (mconcat)
 #endif
 import           Data.Attoparsec.Text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-link-header-1.0.1/library/Network/HTTP/Link/Writer.hs 
new/http-link-header-1.0.3/library/Network/HTTP/Link/Writer.hs
--- old/http-link-header-1.0.1/library/Network/HTTP/Link/Writer.hs      
2015-08-23 22:06:37.000000000 +0200
+++ new/http-link-header-1.0.3/library/Network/HTTP/Link/Writer.hs      
2015-12-27 20:29:33.000000000 +0100
@@ -6,7 +6,7 @@
 ) where
 
 import           Data.Text hiding (map)
-#if __GLASGOW_HASKELL__ < 709
+#if !MIN_VERSION_base(4,8,0)
 import           Data.Monoid (mconcat)
 #endif
 import           Network.URI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-link-header-1.0.1/library/Network/HTTP/Link.hs 
new/http-link-header-1.0.3/library/Network/HTTP/Link.hs
--- old/http-link-header-1.0.1/library/Network/HTTP/Link.hs     2015-07-27 
20:13:35.000000000 +0200
+++ new/http-link-header-1.0.3/library/Network/HTTP/Link.hs     2016-11-14 
12:15:59.000000000 +0100
@@ -9,6 +9,7 @@
 ) where
 
 import           Data.ByteString.Conversion
+import           Web.HttpApiData
 import safe      Network.HTTP.Link.Types
 import safe      Network.HTTP.Link.Writer
 import safe      Network.HTTP.Link.Parser
@@ -18,3 +19,11 @@
 
 instance ToByteString Link where
   builder = builder . writeLink
+
+instance ToHttpApiData [Link] where
+  toUrlPiece = toUrlPiece . writeLinkHeader
+  toHeader = toByteString'
+
+instance ToHttpApiData Link where
+  toUrlPiece = toUrlPiece . writeLink
+  toHeader = toByteString'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-link-header-1.0.1/test-suite/Network/HTTP/LinkSpec.hs 
new/http-link-header-1.0.3/test-suite/Network/HTTP/LinkSpec.hs
--- old/http-link-header-1.0.1/test-suite/Network/HTTP/LinkSpec.hs      
1970-01-01 01:00:00.000000000 +0100
+++ new/http-link-header-1.0.3/test-suite/Network/HTTP/LinkSpec.hs      
2015-12-27 20:29:33.000000000 +0100
@@ -0,0 +1,33 @@
+{-# LANGUAGE OverloadedStrings, UnicodeSyntax, CPP #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+module Network.HTTP.LinkSpec where
+
+import           Test.Hspec
+import           Test.QuickCheck
+#if !MIN_VERSION_base(4,8,0)
+import           Data.Monoid (mconcat)
+#endif
+import qualified Data.Text as T
+import           Data.Maybe (fromJust)
+import           Network.HTTP.Link
+
+instance Arbitrary Link where
+  arbitrary = do
+    urlScheme ← elements ["http://";, "https://";, "ftp://";, "git+ssh://"]
+    urlDomain ← listOf1 $ elements ['a'..'z']
+    urlTld ← elements ["com", "net", "org", "me", "is", "technology", "club"]
+    urlPath ← listOf $ elements ['a'..'z']
+    params ← listOf genParam
+    return $ fromJust $ lnk (mconcat [urlScheme, urlDomain, ".", urlTld, "/", 
urlPath]) params
+    where genParam = do
+            otherParamKey ← listOf1 $ elements ['a'..'z']
+            paramKey ← elements [Rel, Rev, Title, Hreflang, Anchor, Media, 
ContentType, Other (T.pack otherParamKey)]
+            paramValue ← listOf $ elements ['a'..'z']
+            return (paramKey, T.pack paramValue)
+
+spec ∷ Spec
+spec = do
+  describe "writeLinkHeader → parseLinkHeader" $
+    it "roundtrips successfully" $
+      property $ \x → parseLinkHeader (writeLinkHeader x) == Just x


Reply via email to