Hello community,

here is the log from the commit of package hpack for openSUSE:Factory checked 
in at 2019-03-06 15:47:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hpack (Old)
 and      /work/SRC/openSUSE:Factory/.hpack.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hpack"

Wed Mar  6 15:47:30 2019 rev:15 rq:681689 version:0.31.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/hpack/hpack.changes      2018-11-09 
07:53:23.971781311 +0100
+++ /work/SRC/openSUSE:Factory/.hpack.new.28833/hpack.changes   2019-03-06 
15:47:31.632448589 +0100
@@ -1,0 +2,8 @@
+Mon Mar  4 03:02:31 UTC 2019 - psim...@suse.com
+
+- Update hpack to version 0.31.2.
+  ## Changes in 0.31.2
+    - Add default value for maintainer (see #339)
+    - Escape commas and spaces in filenames when generating cabal files
+
+-------------------------------------------------------------------

Old:
----
  hpack-0.31.1.tar.gz

New:
----
  hpack-0.31.2.tar.gz

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

Other differences:
------------------
++++++ hpack.spec ++++++
--- /var/tmp/diff_new_pack.aWNK5C/_old  2019-03-06 15:47:32.764448289 +0100
+++ /var/tmp/diff_new_pack.aWNK5C/_new  2019-03-06 15:47:32.768448288 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package hpack
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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 hpack
 %bcond_with tests
 Name:           %{pkg_name}
-Version:        0.31.1
+Version:        0.31.2
 Release:        0
 Summary:        A modern format for Haskell packages
 License:        MIT

++++++ hpack-0.31.1.tar.gz -> hpack-0.31.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/CHANGELOG.md 
new/hpack-0.31.2/CHANGELOG.md
--- old/hpack-0.31.1/CHANGELOG.md       2018-11-03 21:11:49.000000000 +0100
+++ new/hpack-0.31.2/CHANGELOG.md       2019-03-03 05:34:36.000000000 +0100
@@ -1,3 +1,7 @@
+## Changes in 0.31.2
+  - Add default value for maintainer (see #339)
+  - Escape commas and spaces in filenames when generating cabal files
+
 ## Changes in 0.31.1
   - Show the header when printing to stdout (see #331)
   - Add help for `--numeric-version`(see #337)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/hpack.cabal new/hpack-0.31.2/hpack.cabal
--- old/hpack-0.31.1/hpack.cabal        2018-11-03 21:11:49.000000000 +0100
+++ new/hpack-0.31.2/hpack.cabal        2019-03-03 05:34:36.000000000 +0100
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: d0e64e7193dd79e7d688f56350272b988a08b6f0f9706767a37f122ceeae72ee
+-- hash: 3d060180293c32b8d0c25b710d0f419e96a6cc6ec3f95ac5e70bb77f44cbafc3
 
 name:           hpack
-version:        0.31.1
+version:        0.31.2
 synopsis:       A modern format for Haskell packages
 description:    See README at <https://github.com/sol/hpack#readme>
 category:       Development
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/src/Hpack/Config.hs 
new/hpack-0.31.2/src/Hpack/Config.hs
--- old/hpack-0.31.1/src/Hpack/Config.hs        2018-11-03 21:11:49.000000000 
+0100
+++ new/hpack-0.31.2/src/Hpack/Config.hs        2019-03-03 05:34:36.000000000 
+0100
@@ -62,6 +62,7 @@
 , CppOption
 , CcOption
 , LdOption
+, Path(..)
 #ifdef TEST
 , renameDependencies
 , Empty(..)
@@ -357,9 +358,9 @@
 type ParseCxxSources = Maybe (List FilePath)
 type ParseJsSources = Maybe (List FilePath)
 
-type CSources = [FilePath]
-type CxxSources = [FilePath]
-type JsSources = [FilePath]
+type CSources = [Path]
+type CxxSources = [Path]
+type JsSources = [Path]
 
 type WithCommonOptions cSources cxxSources jsSources a = Product 
(CommonOptions cSources cxxSources jsSources a) a
 
@@ -518,7 +519,7 @@
 , packageConfigCategory :: Maybe String
 , packageConfigStability :: Maybe String
 , packageConfigAuthor :: Maybe (List String)
-, packageConfigMaintainer :: Maybe (List String)
+, packageConfigMaintainer :: Maybe (Maybe (List String))
 , packageConfigCopyright :: Maybe (List String)
 , packageConfigBuildType :: Maybe BuildType
 , packageConfigLicense :: Maybe (Maybe String)
@@ -829,9 +830,9 @@
 , packageLicenseFile :: [FilePath]
 , packageTestedWith :: Maybe String
 , packageFlags :: [Flag]
-, packageExtraSourceFiles :: [FilePath]
-, packageExtraDocFiles :: [FilePath]
-, packageDataFiles :: [FilePath]
+, packageExtraSourceFiles :: [Path]
+, packageExtraDocFiles :: [Path]
+, packageDataFiles :: [Path]
 , packageDataDir :: Maybe FilePath
 , packageSourceRepository :: Maybe SourceRepository
 , packageCustomSetup :: Maybe CustomSetup
@@ -877,10 +878,10 @@
 , sectionGhcjsOptions :: [GhcjsOption]
 , sectionCppOptions :: [CppOption]
 , sectionCcOptions :: [CcOption]
-, sectionCSources :: [FilePath]
+, sectionCSources :: [Path]
 , sectionCxxOptions :: [CxxOption]
-, sectionCxxSources :: [FilePath]
-, sectionJsSources :: [FilePath]
+, sectionCxxSources :: [Path]
+, sectionJsSources :: [Path]
 , sectionExtraLibDirs :: [FilePath]
 , sectionExtraLibraries :: [FilePath]
 , sectionExtraFrameworksDirs :: [FilePath]
@@ -1096,7 +1097,7 @@
       , packageCategory = packageConfigCategory
       , packageStability = packageConfigStability
       , packageAuthor = fromMaybeList packageConfigAuthor
-      , packageMaintainer = fromMaybeList packageConfigMaintainer
+      , packageMaintainer = fromMaybeList maintainer
       , packageCopyright = fromMaybeList packageConfigCopyright
       , packageBuildType = fromMaybe defaultBuildType packageConfigBuildType
       , packageLicense = join packageConfigLicense
@@ -1166,6 +1167,12 @@
       where
         fromGithub = (++ "/issues") . sourceRepositoryUrl <$> github
 
+    maintainer :: Maybe (List String)
+    maintainer = case (packageConfigAuthor, packageConfigMaintainer) of
+      (Just _, Nothing) -> packageConfigAuthor
+      (_, Just m) -> m
+      _            -> Nothing
+
 expandForeignSources
   :: MonadIO m
   => FilePath
@@ -1179,8 +1186,14 @@
     expand fieldName xs = do
       expandGlobs fieldName dir (fromMaybeList xs)
 
-expandGlobs :: MonadIO m => String -> FilePath -> [String] -> Warnings m 
[FilePath]
-expandGlobs name dir patterns = do
+newtype Path = Path { unPath :: FilePath }
+  deriving (Eq, Show, Ord)
+
+instance IsString Path where
+  fromString = Path
+
+expandGlobs :: MonadIO m => String -> FilePath -> [String] -> Warnings m [Path]
+expandGlobs name dir patterns = map Path <$> do
   (warnings, files) <- liftIO $ Util.expandGlobs name dir patterns
   tell warnings
   return files
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/src/Hpack/Render.hs 
new/hpack-0.31.2/src/Hpack/Render.hs
--- old/hpack-0.31.1/src/Hpack/Render.hs        2018-11-03 21:11:49.000000000 
+0100
+++ new/hpack-0.31.2/src/Hpack/Render.hs        2019-03-03 05:34:36.000000000 
+0100
@@ -66,9 +66,9 @@
     packageFields :: [Element]
     packageFields = addVerbatim packageVerbatim . sortFieldsBy 
existingFieldOrder $
       headerFields ++ [
-        Field "extra-source-files" (LineSeparatedList packageExtraSourceFiles)
-      , Field "extra-doc-files" (LineSeparatedList packageExtraDocFiles)
-      , Field "data-files" (LineSeparatedList packageDataFiles)
+        Field "extra-source-files" (renderPaths packageExtraSourceFiles)
+      , Field "extra-doc-files" (renderPaths packageExtraDocFiles)
+      , Field "data-files" (renderPaths packageDataFiles)
       ] ++ maybe [] (return . Field "data-dir" . Literal) packageDataDir
 
     sourceRepository :: [Element]
@@ -233,9 +233,9 @@
   , renderCxxOptions sectionCxxOptions
   , renderDirectories "include-dirs" sectionIncludeDirs
   , Field "install-includes" (LineSeparatedList sectionInstallIncludes)
-  , Field "c-sources" (LineSeparatedList sectionCSources)
-  , Field "cxx-sources" (LineSeparatedList sectionCxxSources)
-  , Field "js-sources" (LineSeparatedList sectionJsSources)
+  , Field "c-sources" (renderPaths sectionCSources)
+  , Field "cxx-sources" (renderPaths sectionCxxSources)
+  , Field "js-sources" (renderPaths sectionJsSources)
   , renderDirectories "extra-lib-dirs" sectionExtraLibDirs
   , Field "extra-libraries" (LineSeparatedList sectionExtraLibraries)
   , renderDirectories "extra-frameworks-dirs" sectionExtraFrameworksDirs
@@ -395,3 +395,14 @@
 
 renderOtherExtensions :: [String] -> Element
 renderOtherExtensions = Field "other-extensions" . WordList
+
+renderPaths :: [Path] -> Value
+renderPaths = LineSeparatedList . map renderPath
+  where
+    renderPath :: Path -> FilePath
+    renderPath (Path path)
+      | needsQuoting path = show path
+      | otherwise = path
+
+    needsQuoting :: FilePath -> Bool
+    needsQuoting = any (\x -> isSpace x || x == ',')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/test/EndToEndSpec.hs 
new/hpack-0.31.2/test/EndToEndSpec.hs
--- old/hpack-0.31.1/test/EndToEndSpec.hs       2018-11-03 21:11:49.000000000 
+0100
+++ new/hpack-0.31.2/test/EndToEndSpec.hs       2019-03-03 05:34:36.000000000 
+0100
@@ -832,6 +832,17 @@
           c-sources: foo/*.c
         |] `shouldWarn` pure "Specified pattern \"foo/*.c\" for c-sources does 
not match any files"
 
+      it "quotes filenames with special characters" $ do
+        touch "cbits/foo bar.c"
+        [i|
+        library:
+          c-sources:
+            - cbits/foo bar.c
+        |] `shouldRenderTo` library_ [i|
+        c-sources:
+            "cbits/foo bar.c"
+        |]
+
     describe "custom-setup" $ do
       it "warns on unknown fields" $ do
         [i|
@@ -1471,6 +1482,30 @@
                 Paths_foo
             default-language: Haskell2010
           |]
+    describe "default value of maintainer" $ do
+      it "gives maintainer precedence" $ do
+        [i|
+          author: John Doe
+          maintainer: Jane Doe
+          |] `shouldRenderTo` package [i|
+          author: John Doe
+          maintainer: Jane Doe
+          |]
+      context "with author" $ do
+        it "uses author if maintainer is not specified" $ do
+          [i|
+            author: John Doe
+            |] `shouldRenderTo` package [i|
+            author: John Doe
+            maintainer: John Doe
+            |]
+        it "omits maintainer if it is null" $ do
+          [i|
+            author: John Doe
+            maintainer: null
+            |] `shouldRenderTo` package [i|
+            author: John Doe
+            |]
 
 run :: HasCallStack => FilePath -> FilePath -> String -> IO ([String], String)
 run userDataDir c old = run_ userDataDir c old >>= either assertFailure return
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.31.1/test/Hpack/ConfigSpec.hs 
new/hpack-0.31.2/test/Hpack/ConfigSpec.hs
--- old/hpack-0.31.1/test/Hpack/ConfigSpec.hs   2018-11-03 21:11:49.000000000 
+0100
+++ new/hpack-0.31.2/test/Hpack/ConfigSpec.hs   2019-03-03 05:34:36.000000000 
+0100
@@ -247,7 +247,8 @@
       withPackageConfig_ [i|
         author: John Doe
         |]
-        (`shouldBe` package {packageAuthor = ["John Doe"]})
+        (`shouldBe` package {packageAuthor = ["John Doe"]
+                            ,packageMaintainer = ["John Doe"]})
 
     it "accepts maintainer" $ do
       withPackageConfig_ [i|


Reply via email to