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 2024-05-13 17:57:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hslua-module-zip (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-hslua-module-zip.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-hslua-module-zip"

Mon May 13 17:57:54 2024 rev:4 rq:1173539 version:1.1.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-hslua-module-zip/ghc-hslua-module-zip.changes    
    2024-01-26 22:47:34.900877422 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-hslua-module-zip.new.1880/ghc-hslua-module-zip.changes
      2024-05-13 17:58:30.978848102 +0200
@@ -1,0 +2,20 @@
+Sun May  5 19:11:49 UTC 2024 - Peter Simons <psim...@suse.com>
+
+- Update hslua-module-zip to version 1.1.3.
+  ## hslua-module-zip-1.1.3
+
+  Released 2024-05-05.
+
+  -   Fix build on Windows. There are no symlinks on Windows;
+      functions dealing with symlinks are missing from zip-archive
+      and need a placeholder function.
+
+  ## hslua-module-zip-1.1.2
+
+  Released 2024-05-05.
+
+  -   Added a `symlink` method to Entry objects. This allows to
+      check whether an entry represents a symbolic link, and where
+      it links.
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ ghc-hslua-module-zip.spec ++++++
--- /var/tmp/diff_new_pack.RWN63u/_old  2024-05-13 17:58:31.742875978 +0200
+++ /var/tmp/diff_new_pack.RWN63u/_new  2024-05-13 17:58:31.742875978 +0200
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.1.1
+Version:        1.1.3
 Release:        0
 Summary:        Lua module to work with file zips
 License:        MIT

++++++ hslua-module-zip-1.1.1.tar.gz -> hslua-module-zip-1.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.1.1/CHANGELOG.md 
new/hslua-module-zip-1.1.3/CHANGELOG.md
--- old/hslua-module-zip-1.1.1/CHANGELOG.md     2001-09-09 03:46:40.000000000 
+0200
+++ new/hslua-module-zip-1.1.3/CHANGELOG.md     2001-09-09 03:46:40.000000000 
+0200
@@ -2,6 +2,22 @@
 
 `hslua-module-zips` uses [PVP Versioning][].
 
+## hslua-module-zip-1.1.3
+
+Released 2024-05-05.
+
+-   Fix build on Windows. There are no symlinks on Windows;
+    functions dealing with symlinks are missing from zip-archive
+    and need a placeholder function.
+
+## hslua-module-zip-1.1.2
+
+Released 2024-05-05.
+
+-   Added a `symlink` method to Entry objects. This allows to
+    check whether an entry represents a symbolic link, and where
+    it links.
+
 ## hslua-module-zip-1.1.1
 
 Released 2024-01-18.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.1.1/hslua-module-zip.cabal 
new/hslua-module-zip-1.1.3/hslua-module-zip.cabal
--- old/hslua-module-zip-1.1.1/hslua-module-zip.cabal   2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.3/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.1.1
+version:             1.1.3
 synopsis:            Lua module to work with file zips.
 description:         Module with function for creating, modifying, and
                      extracting files from zip archives.
@@ -65,6 +65,8 @@
   import:              common-options
   hs-source-dirs:      src
   exposed-modules:     HsLua.Module.Zip
+  if os(windows)
+    cpp-options:       -D_WINDOWS
 
 test-suite hslua-module-zip-test
   import:              common-options
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.1.1/src/HsLua/Module/Zip.hs 
new/hslua-module-zip-1.1.3/src/HsLua/Module/Zip.hs
--- old/hslua-module-zip-1.1.1/src/HsLua/Module/Zip.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.3/src/HsLua/Module/Zip.hs  2001-09-09 
03:46:40.000000000 +0200
@@ -28,6 +28,7 @@
   , peekEntryFuzzy
   -- ** entry methods
   , contents
+  , symlink
   -- * Zip Options
   , peekZipOptions
   )
@@ -36,7 +37,12 @@
 import Prelude hiding (zip)
 import Control.Applicative (optional)
 import Control.Monad ((<$!>))
-import Codec.Archive.Zip (Archive, Entry, ZipOption (..), emptyArchive)
+import Codec.Archive.Zip
+  ( Archive, Entry, ZipOption (..), emptyArchive
+#ifndef _WINDOWS
+  , symbolicLinkEntryTarget
+#endif
+  )
 import Data.Functor ((<&>))
 import Data.Maybe (catMaybes, fromMaybe)
 import Data.Time.Clock.POSIX (getPOSIXTime)
@@ -44,7 +50,7 @@
 import HsLua.Core
   ( LuaError, NumArgs (..), NumResults (..), Type(..), call, failLua
   , fromStackIndex, getfield, gettop, replace, liftIO, ltype
-  , nth, nthBottom, setmetatable )
+  , nth, nthBottom, pushnil, setmetatable )
 import HsLua.List (newListMetatable)
 import HsLua.Marshalling
   ( Peeker, Pusher, choice, failPeek, liftLua, peekBool
@@ -57,6 +63,11 @@
 import qualified Codec.Archive.Zip as Zip
 import qualified Data.Text as T
 
+#ifdef _WINDOWS
+-- | Windows replacement; always returns Nothing.
+symbolicLinkEntryTarget :: Entry -> Maybe FilePath
+symbolicLinkEntryTarget = const Nothing
+#endif
 
 -- | The @zip@ module specification.
 documentedModule :: forall e. LuaError e => Module e
@@ -253,6 +264,7 @@
     (pushIntegral, Zip.eLastModified)
     (peekIntegral, \entry modtime -> entry { Zip.eLastModified = modtime})
   , method contents
+  , method symlink
   ]
 
 -- | Creates a new 'ZipEntry' from a file; wraps 'Zip.readEntry'.
@@ -288,6 +300,18 @@
      , "if decrypting fails."
      ]
 
+-- | Returns the target if the Entry represents a symbolic link.
+symlink :: LuaError e => DocumentedFunction e
+symlink = defun "symlink"
+  ### liftPure symbolicLinkEntryTarget
+  <#> udparam typeEntry "self" ""
+  =#> functionResult (maybe pushnil pushString) "string|nil"
+        "link target if entry represents a symbolic link"
+  #? T.unlines
+     [ "Returns the target if the Entry represents a symbolic link,"
+     , "and `nil` otherwise. Always returns `nil` on Windows. "
+     ]
+
 peekEntryFuzzy :: LuaError e => Peeker e Entry
 peekEntryFuzzy = retrieving "ZipEntry" . \idx ->
   liftLua (ltype idx) >>= \case
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hslua-module-zip-1.1.1/test/test-zip.lua 
new/hslua-module-zip-1.1.3/test/test-zip.lua
--- old/hslua-module-zip-1.1.1/test/test-zip.lua        2001-09-09 
03:46:40.000000000 +0200
+++ new/hslua-module-zip-1.1.3/test/test-zip.lua        2001-09-09 
03:46:40.000000000 +0200
@@ -149,7 +149,7 @@
       system.with_tmpdir('archive', function (tmpdir)
         system.with_wd(tmpdir, function ()
           local filename = 'greetings.txt'
-          local fh = io.open(filename, 'w')
+          local fh = io.open(filename, 'wb')
           fh:write('Hi Mom!\n')
           fh:close()
           local entry = zip.read_entry(filename)
@@ -162,7 +162,7 @@
       system.with_tmpdir('archive', function (tmpdir)
         system.with_wd(tmpdir, function ()
           local filename = 'greetings.txt'
-          local fh = io.open(filename, 'w')
+          local fh = io.open(filename, 'wb')
           fh:write('Hallo!\n')
           fh:close()
           local entry = zip.read_entry(filename)
@@ -172,6 +172,21 @@
           )
         end)
       end)
+    end),
+
+    -- Can't reliably test this for actual symlinks, as Windows doesn't
+    -- support them. Only the behavior for normal files is tested.
+    test('has symlink function', function ()
+      system.with_tmpdir('archive', function (tmpdir)
+        system.with_wd(tmpdir, function ()
+          local filename = 'greetings.txt'
+          local fh = io.open(filename, 'w')
+          fh:write('Hallo!\n')
+          fh:close()
+          local entry = zip.read_entry(filename)
+          assert.is_nil(entry:symlink())
+        end)
+      end)
     end)
   },
 

Reply via email to