Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package hpack for openSUSE:Factory checked 
in at 2022-02-11 23:08:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hpack (Old)
 and      /work/SRC/openSUSE:Factory/.hpack.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hpack"

Fri Feb 11 23:08:15 2022 rev:24 rq:953411 version:0.34.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/hpack/hpack.changes      2021-11-11 
21:37:40.972943827 +0100
+++ /work/SRC/openSUSE:Factory/.hpack.new.1956/hpack.changes    2022-02-11 
23:10:07.459070016 +0100
@@ -1,0 +2,9 @@
+Fri Nov 26 20:01:46 UTC 2021 - Peter Simons <[email protected]>
+
+- Update hpack to version 0.34.6.
+  Upstream has edited the change log file since the last release in
+  a non-trivial way, i.e. they did more than just add a new entry
+  at the top. You can review the file at:
+  http://hackage.haskell.org/package/hpack-0.34.6/src/CHANGELOG.md
+
+-------------------------------------------------------------------

Old:
----
  hpack-0.34.5.tar.gz

New:
----
  hpack-0.34.6.tar.gz

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

Other differences:
------------------
++++++ hpack.spec ++++++
--- /var/tmp/diff_new_pack.zmaClM/_old  2022-02-11 23:10:07.967071486 +0100
+++ /var/tmp/diff_new_pack.zmaClM/_new  2022-02-11 23:10:07.971071497 +0100
@@ -19,7 +19,7 @@
 %global pkg_name hpack
 %bcond_with tests
 Name:           %{pkg_name}
-Version:        0.34.5
+Version:        0.34.6
 Release:        0
 Summary:        A modern format for Haskell packages
 License:        MIT

++++++ hpack-0.34.5.tar.gz -> hpack-0.34.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.34.5/CHANGELOG.md 
new/hpack-0.34.6/CHANGELOG.md
--- old/hpack-0.34.5/CHANGELOG.md       2001-09-09 03:46:40.000000000 +0200
+++ new/hpack-0.34.6/CHANGELOG.md       2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,6 @@
+## Changes in 0.34.6
+  - Add `Paths_` module to `autogen-modules` when `cabal-version >= 2`
+
 ## Changes in 0.34.5
   - Compatibility with `aeson-2.*`
 
@@ -11,7 +14,7 @@
   - Reject empty `then` / `else` sections (see #362)
   - Omit conditionals that are always `false` from generated `.cabal` file
     (see #404)
-  - Infer correct `cabal-version` when `Path_` is used with `RebindableSyntax`
+  - Infer correct `cabal-version` when `Paths_` is used with `RebindableSyntax`
     and `OverloadedStrings` or `OverloadedLists` (see #400)
   - Do not use indentation from any existing `.cabal` file if it is invalid
     (e.g. `0`) (fixes #252)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.34.5/hpack.cabal new/hpack-0.34.6/hpack.cabal
--- old/hpack-0.34.5/hpack.cabal        2001-09-09 03:46:40.000000000 +0200
+++ new/hpack-0.34.6/hpack.cabal        2001-09-09 03:46:40.000000000 +0200
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.34.4.
+-- This file has been generated from package.yaml by hpack version 0.34.5.
 --
 -- see: https://github.com/sol/hpack
 
 name:           hpack
-version:        0.34.5
+version:        0.34.6
 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.34.5/src/Hpack/Config.hs 
new/hpack-0.34.6/src/Hpack/Config.hs
--- old/hpack-0.34.5/src/Hpack/Config.hs        2001-09-09 03:46:40.000000000 
+0200
+++ new/hpack-0.34.6/src/Hpack/Config.hs        2001-09-09 03:46:40.000000000 
+0200
@@ -676,15 +676,49 @@
   VerbatimBool b -> show b
   VerbatimNull -> ""
 
-determineCabalVersion :: Maybe (License SPDX.License) -> Package -> (Package, 
String)
+addPathsModuleToGeneratedModules  :: Package -> Version -> Package
+addPathsModuleToGeneratedModules pkg cabalVersion
+  | cabalVersion < makeVersion [2] = pkg
+  | otherwise = pkg {
+      packageLibrary = fmap mapLibrary <$> packageLibrary pkg
+    , packageInternalLibraries = fmap mapLibrary <$> packageInternalLibraries 
pkg
+    , packageExecutables = fmap mapExecutable <$> packageExecutables pkg
+    , packageTests = fmap mapExecutable <$> packageTests pkg
+    , packageBenchmarks = fmap mapExecutable <$> packageBenchmarks pkg
+    }
+  where
+    pathsModule = pathsModuleFromPackageName (packageName pkg)
+
+    mapLibrary :: Library -> Library
+    mapLibrary lib
+      | pathsModule `elem` getLibraryModules lib = lib {
+          libraryGeneratedModules = if pathsModule `elem` generatedModules 
then generatedModules else pathsModule : generatedModules
+        }
+      | otherwise = lib
+      where
+        generatedModules = libraryGeneratedModules lib
+
+    mapExecutable :: Executable -> Executable
+    mapExecutable executable
+      | pathsModule `elem` executableOtherModules executable = executable {
+          executableGeneratedModules = if pathsModule `elem` generatedModules 
then generatedModules else pathsModule : generatedModules
+        }
+      | otherwise = executable
+      where
+        generatedModules = executableGeneratedModules executable
+
+determineCabalVersion :: Maybe (License SPDX.License) -> Package -> (Package, 
String, Maybe Version)
 determineCabalVersion inferredLicense pkg@Package{..} = (
     pkg {
         packageVerbatim = deleteVerbatimField "cabal-version" packageVerbatim
       , packageLicense = formatLicense <$> license
       }
-  , "cabal-version: " ++ fromMaybe inferredCabalVersion verbatimCabalVersion 
++ "\n\n"
+  , "cabal-version: " ++ effectiveCabalVersion ++ "\n\n"
+  , parseVersion effectiveCabalVersion
   )
   where
+    effectiveCabalVersion = fromMaybe inferredCabalVersion verbatimCabalVersion
+
     license = fmap prettyShow <$> (parsedLicense <|> inferredLicense)
 
     parsedLicense = parseLicense <$> packageLicense
@@ -1184,7 +1218,9 @@
 
   tell nameWarnings
   tell (formatMissingSourceDirs missingSourceDirs)
-  return (determineCabalVersion inferredLicense pkg)
+
+  let (pkg_, renderedCabalVersion, cabalVersion) = determineCabalVersion 
inferredLicense pkg
+  return (maybe pkg_ (addPathsModuleToGeneratedModules pkg_) cabalVersion, 
renderedCabalVersion)
   where
     nameWarnings :: [String]
     packageName_ :: String
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hpack-0.34.5/test/EndToEndSpec.hs 
new/hpack-0.34.6/test/EndToEndSpec.hs
--- old/hpack-0.34.5/test/EndToEndSpec.hs       2001-09-09 03:46:40.000000000 
+0200
+++ new/hpack-0.34.6/test/EndToEndSpec.hs       2001-09-09 03:46:40.000000000 
+0200
@@ -79,6 +79,47 @@
             Paths_foo
         |]
 
+      context "when cabal-version is >= 2" $ do
+        it "adds Paths_ to autogen-modules" $ do
+          [i|
+          verbatim:
+            cabal-version: 2.0
+          library: {}
+          |] `shouldRenderTo` (library [i|
+          other-modules:
+              Paths_foo
+          autogen-modules:
+              Paths_foo
+          |]) { packageCabalVersion = "2.0" }
+
+        context "when Paths_ module is listed explicitly under 
generated-other-modules" $ do
+          it "adds Paths_ to autogen-modules only once" $ do
+            [i|
+            verbatim:
+              cabal-version: 2.0
+            library:
+              generated-other-modules: Paths_foo
+            |] `shouldRenderTo` (library [i|
+            other-modules:
+                Paths_foo
+            autogen-modules:
+                Paths_foo
+            |]) { packageCabalVersion = "2.0" }
+
+        context "when Paths_ module is listed explicitly under 
generated-exposed-modules" $ do
+          it "adds Paths_ to autogen-modules only once" $ do
+            [i|
+            verbatim:
+              cabal-version: 2.0
+            library:
+              generated-exposed-modules: Paths_foo
+            |] `shouldRenderTo` (library [i|
+            exposed-modules:
+                Paths_foo
+            autogen-modules:
+                Paths_foo
+            |]) { packageCabalVersion = "2.0" }
+
       context "when Paths_ is mentioned in a conditional that is always false" 
$ do
         it "does not add Paths_" $ do
           [i|
@@ -100,6 +141,8 @@
               OverloadedStrings
           other-modules:
               Paths_foo
+          autogen-modules:
+              Paths_foo
           |]) {packageCabalVersion = "2.2"}
 
         context "when Paths_ is mentioned in a conditional that is always 
false" $ do
@@ -455,6 +498,8 @@
           library
             other-modules:
                 Paths_foo
+            autogen-modules:
+                Paths_foo
             cxx-options: -Wall
             default-language: Haskell2010
           |]) {packageCabalVersion = "2.2"}
@@ -469,6 +514,8 @@
           library
             other-modules:
                 Paths_foo
+            autogen-modules:
+                Paths_foo
             cxx-options: -Wall
             default-language: Haskell2010
           |]) {packageCabalVersion = "2.2"}
@@ -671,6 +718,8 @@
             system-build-tools:
               g++ >= 5.4.0
           |] `shouldRenderTo` (executable_ "foo" [i|
+          autogen-modules:
+              Paths_foo
           build-tools:
               g++ >=5.4.0
           |]) {packageCabalVersion = "2.0"}
@@ -690,6 +739,8 @@
         executable:
           dependencies: foo:bar
         |] `shouldRenderTo` (executable_ "foo" [i|
+        autogen-modules:
+            Paths_foo
         build-depends:
             foo:bar
         |]) {packageCabalVersion = "3.0"}
@@ -800,6 +851,8 @@
         executable:
           cxx-options: -Wall
         |] `shouldRenderTo` (executable_ "foo" [i|
+        autogen-modules:
+            Paths_foo
         cxx-options: -Wall
         |]) {packageCabalVersion = "2.2"}
 
@@ -815,6 +868,8 @@
                   condition: True
                   cxx-options: -Wall
           |] `shouldRenderTo` (executable_ "foo" [i|
+          autogen-modules:
+              Paths_foo
           if true
             if true
               if true
@@ -829,6 +884,8 @@
             - foo.cc
             - cxxbits/*.cc
         |] `shouldRenderTo` (executable_ "foo" [i|
+        autogen-modules:
+            Paths_foo
         cxx-sources:
             foo.cc
             cxxbits/bar.cc
@@ -979,6 +1036,8 @@
         library:
           signatures: Foo
         |] `shouldRenderTo` (library_ [i|
+          autogen-modules:
+              Paths_foo
           signatures:
               Foo
         |]) {packageCabalVersion = "2.0"}
@@ -1008,6 +1067,8 @@
           |] `shouldRenderTo` (library [i|
           other-modules:
               Paths_foo
+          autogen-modules:
+              Paths_foo
           build-depends:
               foo
           mixins:
@@ -1026,6 +1087,8 @@
             Foo
         other-modules:
             Paths_foo
+        autogen-modules:
+            Paths_foo
         hs-source-dirs:
             src
         |]
@@ -1055,6 +1118,8 @@
         visibility: public
         other-modules:
             Paths_foo
+        autogen-modules:
+            Paths_foo
         |]) {packageCabalVersion = "3.0"}
 
     context "when inferring modules" $ do
@@ -1239,6 +1304,7 @@
                 Paths_foo
                 Bar
             autogen-modules:
+                Paths_foo
                 Foo
                 Bar
             |]) {packageCabalVersion = "2.0"}
@@ -1260,6 +1326,7 @@
                 Paths_foo
                 Other
             autogen-modules:
+                Paths_foo
                 Exposed
                 Other
             |]) {packageCabalVersion = "2.0"}
@@ -1277,6 +1344,8 @@
             |] `shouldRenderTo` (library [i|
             other-modules:
                 Paths_foo
+            autogen-modules:
+                Paths_foo
             hs-source-dirs:
                 src
             if os(windows)
@@ -1340,6 +1409,7 @@
                 Paths_foo
                 Foo
             autogen-modules:
+                Paths_foo
                 Foo
           |]) {packageCabalVersion = "2.0"}
 

Reply via email to