zip-archive 0.1.1.6 → 0.1.1.7
raw patch · 3 files changed
+11/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Codec/Archive/Zip.hs +8/−5
- Tests.hs +1/−1
- zip-archive.cabal +2/−1
Codec/Archive/Zip.hs view
@@ -268,9 +268,10 @@ zipifyFilePath path = let dir = takeDirectory path fn = takeFileName path- (drive, dir') = splitDrive dir- dirParts = splitDirectories dir'- in drive ++ (concat (map (++ "/") dirParts)) ++ fn+ (_drive, dir') = splitDrive dir+ -- note: some versions of filepath return ["."] if no dir+ dirParts = dropWhile (==".") $ splitDirectories dir'+ in (concat (map (++ "/") dirParts)) ++ fn -- | Uncompress a lazy bytestring. compressData :: CompressionMethod -> B.ByteString -> B.ByteString@@ -537,7 +538,8 @@ putWord32le $ eCRC32 f putWord32le $ eCompressedSize f putWord32le $ eUncompressedSize f- putWord16le $ fromIntegral $ length $ eRelativePath f+ putWord16le $ fromIntegral $ B.length $ fromString+ $ zipifyFilePath $ eRelativePath f putWord16le $ fromIntegral $ B.length $ eExtraField f putLazyByteString $ fromString $ zipifyFilePath $ eRelativePath f putLazyByteString $ eExtraField f@@ -636,7 +638,8 @@ putWord32le $ eCRC32 local putWord32le $ eCompressedSize local putWord32le $ eUncompressedSize local- putWord16le $ fromIntegral $ length $ eRelativePath local+ putWord16le $ fromIntegral $ B.length $ fromString+ $ zipifyFilePath $ eRelativePath local putWord16le $ fromIntegral $ B.length $ eExtraField local putWord16le $ fromIntegral $ B.length $ eFileComment local putWord16le 0 -- disk number start
Tests.hs view
@@ -41,7 +41,7 @@ assertEqual "for writing and reading test1.zip" archive archive' testReadExternalZip = TestCase $ do- runCommand "zip -q -9 test-temp/test4.zip zip-archive.cabal Codec/Archive/Zip.hs" >>= waitForProcess+ runCommand "/usr/bin/zip -q -9 test-temp/test4.zip zip-archive.cabal Codec/Archive/Zip.hs" >>= waitForProcess archive <- toArchive <$> B.readFile "test-temp/test4.zip" let files = filesInArchive archive assertEqual "for results of filesInArchive" ["zip-archive.cabal", "Codec/Archive/Zip.hs"] files
zip-archive.cabal view
@@ -1,5 +1,5 @@ Name: zip-archive-Version: 0.1.1.6+Version: 0.1.1.7 Cabal-version: >= 1.2 Build-type: Simple Synopsis: Library for creating and modifying zip archives.@@ -8,6 +8,7 @@ Category: Codec License: GPL License-file: LICENSE+Homepage: http://github.com/jgm/zip-archive Author: John MacFarlane Maintainer: jgm@berkeley.edu Build-Depends: base