Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-hslua-module-zip for 
openSUSE:Factory checked in at 2023-04-14 13:13:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hslua-module-zip (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-hslua-module-zip.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-hslua-module-zip"

Fri Apr 14 13:13:05 2023 rev:2 rq:1079191 version:1.1.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-hslua-module-zip/ghc-hslua-module-zip.changes    
    2023-04-04 21:20:48.261327453 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-hslua-module-zip.new.19717/ghc-hslua-module-zip.changes
     2023-04-14 13:13:17.551637424 +0200
@@ -1,0 +2,9 @@
+Thu Apr 13 12:06:24 UTC 2023 - Peter Simons <[email protected]>
+
+- Update hslua-module-zip to version 1.1.0.
+  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/hslua-module-zip-1.1.0/src/CHANGELOG.md
+
+-------------------------------------------------------------------

Old:
----
  hslua-module-zip-1.0.0.tar.gz

New:
----
  hslua-module-zip-1.1.0.tar.gz

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

Other differences:
------------------
++++++ ghc-hslua-module-zip.spec ++++++
--- /var/tmp/diff_new_pack.Vfd5zE/_old  2023-04-14 13:13:18.011640055 +0200
+++ /var/tmp/diff_new_pack.Vfd5zE/_new  2023-04-14 13:13:18.015640078 +0200
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.0.0
+Version:        1.1.0
 Release:        0
 Summary:        Lua module to work with file zips
 License:        MIT
@@ -41,6 +41,8 @@
 BuildRequires:  ghc-hslua-marshalling-prof
 BuildRequires:  ghc-hslua-packaging-devel
 BuildRequires:  ghc-hslua-packaging-prof
+BuildRequires:  ghc-hslua-typing-devel
+BuildRequires:  ghc-hslua-typing-prof
 BuildRequires:  ghc-rpm-macros
 BuildRequires:  ghc-text-devel
 BuildRequires:  ghc-text-prof

++++++ hslua-module-zip-1.0.0.tar.gz -> hslua-module-zip-1.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/CHANGELOG.md 
new/hslua-module-zip-1.1.0/CHANGELOG.md
--- old/hslua-module-zip-1.0.0/CHANGELOG.md     2001-09-09 03:46:40.000000000 
+0200
+++ new/hslua-module-zip-1.1.0/CHANGELOG.md     2001-09-09 03:46:40.000000000 
+0200
@@ -4,7 +4,7 @@
 
 ## hslua-module-zip-1.0.0
 
-Release pending.
+Released 2023-03-13.
 
 -   Initially created.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/LICENSE 
new/hslua-module-zip-1.1.0/LICENSE
--- old/hslua-module-zip-1.0.0/LICENSE  2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.0/LICENSE  2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright © 2020-2022 Albert Krewinkel
+Copyright © 2020-2023 Albert Krewinkel
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/hslua-module-zip.cabal 
new/hslua-module-zip-1.1.0/hslua-module-zip.cabal
--- old/hslua-module-zip-1.0.0/hslua-module-zip.cabal   2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.0/hslua-module-zip.cabal   2001-09-09 
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
 cabal-version:       2.2
 name:                hslua-module-zip
-version:             1.0.0
+version:             1.1.0
 synopsis:            Lua module to work with file zips.
 description:         Module with function for creating, modifying, and
                      extracting files from zip archives.
@@ -9,21 +9,20 @@
 license:             MIT
 license-file:        LICENSE
 author:              Albert Krewinkel
-maintainer:          Albert Krewinkel <[email protected]>
-copyright:           © 2020-2022 Albert Krewinkel
+maintainer:          Albert Krewinkel <[email protected]>
+copyright:           © 2020-2023 Albert Krewinkel
 category:            Foreign
 build-type:          Simple
 extra-doc-files:     README.md
                      CHANGELOG.md
 extra-source-files:  test/test-zip.lua
-tested-with:         GHC == 8.0.2
-                   , GHC == 8.2.2
-                   , GHC == 8.4.4
+tested-with:         GHC == 8.4.4
                    , GHC == 8.6.5
                    , GHC == 8.8.4
                    , GHC == 8.10.7
                    , GHC == 9.0.2
-                   , GHC == 9.2.3
+                   , GHC == 9.2.5
+                   , GHC == 9.4.4
 
 source-repository head
   type:                git
@@ -31,13 +30,14 @@
   subdir:              hslua-module-zip
 
 common common-options
-  build-depends:       base              >= 4.9.1  && < 5
+  build-depends:       base              >= 4.11   && < 5
                      , bytestring
                      , filepath          >= 1.4    && < 1.5
-                     , hslua-core        >= 2.1    && < 2.3
+                     , hslua-core        >= 2.3    && < 2.4
                      , hslua-list        >= 1.1    && < 1.2
-                     , hslua-marshalling >= 2.1    && < 2.3
-                     , hslua-packaging   >= 2.1    && < 2.3
+                     , hslua-marshalling >= 2.3    && < 2.4
+                     , hslua-packaging   >= 2.3    && < 2.4
+                     , hslua-typing      >= 0.1    && < 0.2
                      , text              >= 1.2    && < 2.1
                      , time              >= 1.5    && < 1.14
                      , zip-archive       >= 0.4    && < 0.5
@@ -73,7 +73,7 @@
                      , hslua-module-system
                      , tasty
                      , tasty-hunit
-                     , tasty-lua         >= 1.0    && < 1.1
+                     , tasty-lua         >= 1.0    && < 1.2
                      , text
   ghc-options:         -threaded
                        -rtsopts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/src/HsLua/Module/Zip.hs 
new/hslua-module-zip-1.1.0/src/HsLua/Module/Zip.hs
--- old/hslua-module-zip-1.0.0/src/HsLua/Module/Zip.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.0/src/HsLua/Module/Zip.hs  2001-09-09 
03:46:40.000000000 +0200
@@ -5,9 +5,9 @@
 {-# LANGUAGE TypeApplications    #-}
 {-|
 Module      : HsLua.Module.Zip
-Copyright   : © 2022 Albert Krewinkel
+Copyright   : © 2022-2023 Albert Krewinkel
 License     : MIT
-Maintainer  : Albert Krewinkel <[email protected]>
+Maintainer  : Albert Krewinkel <[email protected]>
 
 Lua module to work with file zips.
 -}
@@ -37,10 +37,8 @@
 import Control.Applicative (optional)
 import Control.Monad ((<$!>))
 import Codec.Archive.Zip (Archive, Entry, ZipOption (..), emptyArchive)
+import Data.Functor ((<&>))
 import Data.Maybe (catMaybes, fromMaybe)
-#if !MIN_VERSION_base(4,11,0)
-import Data.Semigroup (Semigroup(..))  -- includes (<>)
-#endif
 import Data.Time.Clock.POSIX (getPOSIXTime)
 import Data.Version (Version, makeVersion)
 import HsLua.Core
@@ -54,24 +52,34 @@
   , pushLazyByteString, pushList, pushIntegral, pushString
   , retrieving, typeMismatchMessage )
 import HsLua.Packaging
+import HsLua.Typing
 
 import qualified Codec.Archive.Zip as Zip
 import qualified Data.Text as T
 
-#if MIN_VERSION_base(4,11,0)
-import Data.Functor ((<&>))
-#else
-(<&>) :: Functor f => f a -> (a -> b) -> f b
-(<&>) = flip fmap
-#endif
 
 -- | The @zip@ module specification.
 documentedModule :: forall e. LuaError e => Module e
 documentedModule = Module
   { moduleName = "zip"
-  , moduleDescription = T.unwords
-    [ "Function for creating, modifying, and extracting files from zip"
-    , "archives."
+  , moduleDescription = T.unlines
+    [ "Functions to create, modify, and extract files from zip archives."
+    , ""
+    , "The module can be called as a function, in which case it behaves"
+    , "like the `zip` function described below."
+    , ""
+    , "Zip options are optional; when defined, they must be a table with"
+    , "any of the following keys:"
+    , ""
+    , "  - `recursive`: recurse directories when set to `true`;"
+    , "  - `verbose`: print info messages to stdout;"
+    , "  - `destination`: the value specifies the directory in which to"
+    , "    extract;"
+    , "  - `location`: value is used as path name, defining where files"
+    , "    are placed."
+    , "  - `preserve_symlinks`: Boolean value, controlling whether"
+    , "    symbolic links are preserved as such. This option is ignored"
+    , "    on Windows."
     ]
   , moduleFields = fields
   , moduleFunctions = functions
@@ -86,6 +94,10 @@
               pure (NumResults 1))
       =?> "new Archive"
     ]
+  , moduleTypeInitializers =
+      [ initType typeArchive
+      , initType typeEntry
+      ]
   }
 
 -- | First published version of this library.
@@ -167,10 +179,11 @@
 --
 
 -- | The Lua 'Archive' type
-typeArchive :: LuaError e => DocumentedType e Archive
-typeArchive = deftype "ZipArchive"
+typeArchive :: forall e. LuaError e => DocumentedType e Archive
+typeArchive = deftype "zip.Archive"
   []
-  [ property "entries" "files in this zip archive"
+  [ property' "entries" (seqType (udTypeSpec @e typeEntry))
+    "Files in this zip archive"
     (pushEntries, Zip.zEntries)
     (peekList peekEntryFuzzy, \ar entries -> ar { Zip.zEntries = entries })
   , method extract
@@ -178,7 +191,7 @@
   ]
 
 -- | Wrapper for 'Zip.toArchive'; converts a string into an Archive.
-mkArchive :: LuaError e => DocumentedFunction e
+mkArchive :: forall e. LuaError e => DocumentedFunction e
 mkArchive = defun "Archive"
   ### (\case
           Nothing                ->
@@ -189,8 +202,9 @@
             pure $ foldr Zip.addEntryToArchive emptyArchive entries)
   <#> opt (parameter (choice [ fmap Left  . peekLazyByteString
                              , fmap Right . peekList peekEntryFuzzy ])
-           "string|{ZipEntry,...}" "contents"
-           "binary archive data or list of entries")
+           (stringType #|# seqType (udTypeSpec @e typeEntry))
+           "bytestring_or_entries"
+           "binary archive data or list of entries; defaults to an empty list")
   =#> udresult typeArchive "new Archive"
   #? T.unlines
      [ "Reads an *Archive* structure from a raw zip archive or a list of"
@@ -227,13 +241,15 @@
 --
 
 -- | The Lua type for 'Entry' objects.
-typeEntry :: LuaError e => DocumentedType e Entry
-typeEntry = deftype "ZipEntry"
+typeEntry :: forall e. LuaError e => DocumentedType e Entry
+typeEntry = deftype "zip.Entry"
   []
-  [ property "path" "relative path, using `/` as separator"
+  [ property' "path" (udTypeSpec @e typeEntry)
+    "Relative path, using `/` as separator"
     (pushString, Zip.eRelativePath)
     (peekString, \entry path -> entry { Zip.eRelativePath = path })
-  , property "modtime" "modification time (seconds since unix epoch)"
+  , property' "modtime" integerType
+    "Modification time (seconds since unix epoch)"
     (pushIntegral, Zip.eLastModified)
     (peekIntegral, \entry modtime -> entry { Zip.eLastModified = modtime})
   , method contents
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/test/test-hslua-module-zip.hs 
new/hslua-module-zip-1.1.0/test/test-hslua-module-zip.hs
--- old/hslua-module-zip-1.0.0/test/test-hslua-module-zip.hs    2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.0/test/test-hslua-module-zip.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -2,9 +2,9 @@
 {-# LANGUAGE TypeApplications  #-}
 {-|
 Module      : Main
-Copyright   : © 2021-2022 Albert Krewinkel
+Copyright   : © 2021-2023 Albert Krewinkel
 License     : MIT
-Maintainer  : Albert Krewinkel <[email protected]>
+Maintainer  : Albert Krewinkel <[email protected]>
 Stability   : stable
 Portability : Requires language extensions ForeignFunctionInterface,
               OverloadedStrings.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.0.0/test/test-zip.lua 
new/hslua-module-zip-1.1.0/test/test-zip.lua
--- old/hslua-module-zip-1.0.0/test/test-zip.lua        2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.0/test/test-zip.lua        2001-09-09 
03:46:40.000000000 +0200
@@ -67,14 +67,18 @@
     end),
 
     test('module metamethod', function()
-      local filename = 'greetings.txt'
-      local fh = io.open(filename, 'w')
-      fh:write('Hi Mom!\n')
-      fh:close()
-      assert.are_equal(
-        zip.zip{filename}:bytestring(),
-        zip{filename}:bytestring()
-      )
+      system.with_tmpdir('archive', function (tmpdir)
+        system.with_wd(tmpdir, function ()
+          local filename = 'greetings.txt'
+          local fh = io.open(filename, 'w')
+          fh:write('Hi Mom!\n')
+          fh:close()
+          assert.are_equal(
+            zip.zip{filename}:bytestring(),
+            zip{filename}:bytestring()
+          )
+        end)
+      end)
     end)
   },
 
@@ -87,16 +91,17 @@
             filename = filename,
             contents = 'Hi Mom!\n',
           }
-          archive:extract{destination = 'foo'}
-          assert.are_equal(system.ls()[1], 'foo')
+          archive:extract()
+
+          assert.are_equal(system.ls()[1], filename)
           assert.are_equal(
-            io.open('foo/' .. filename):read 'a',
+            io.open(filename):read 'a',
             'Hi Mom!\n'
           )
         end)
       end)
     end),
-    test('archive with file', function ()
+    test('to destination directory', function ()
       system.with_tmpdir('archive', function (tmpdir)
         system.with_wd(tmpdir, function ()
           local filename = 'greetings.txt'
@@ -104,16 +109,15 @@
             filename = filename,
             contents = 'Hi Mom!\n',
           }
-          archive:extract()
-
-          assert.are_equal(system.ls()[1], filename)
+          archive:extract{destination = 'foo'}
+          assert.are_equal(system.ls()[1], 'foo')
           assert.are_equal(
-            io.open(filename):read 'a',
+            io.open('foo/' .. filename):read 'a',
             'Hi Mom!\n'
           )
         end)
       end)
-    end)
+    end),
   },
 
   group 'entries' {

Reply via email to