hslua-module-zip 1.1.2 → 1.1.3
raw patch · 4 files changed
+25/−5 lines, 4 filesdep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: time
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- hslua-module-zip.cabal +3/−1
- src/HsLua/Module/Zip.hs +12/−2
- test/test-zip.lua +2/−2
CHANGELOG.md view
@@ -2,6 +2,14 @@ `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.
hslua-module-zip.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hslua-module-zip-version: 1.1.2+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
src/HsLua/Module/Zip.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -37,7 +38,11 @@ import Control.Applicative (optional) import Control.Monad ((<$!>)) import Codec.Archive.Zip- ( Archive, Entry, ZipOption (..), emptyArchive, symbolicLinkEntryTarget )+ ( Archive, Entry, ZipOption (..), emptyArchive+#ifndef _WINDOWS+ , symbolicLinkEntryTarget+#endif+ ) import Data.Functor ((<&>)) import Data.Maybe (catMaybes, fromMaybe) import Data.Time.Clock.POSIX (getPOSIXTime)@@ -58,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@@ -299,7 +309,7 @@ "link target if entry represents a symbolic link" #? T.unlines [ "Returns the target if the Entry represents a symbolic link,"- , "and `nil` otherwise."+ , "and `nil` otherwise. Always returns `nil` on Windows. " ] peekEntryFuzzy :: LuaError e => Peeker e Entry
test/test-zip.lua view
@@ -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)