tar-bytestring 0.6.1.3 → 0.6.2.0
raw patch · 5 files changed
+40/−9 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Codec/Archive/Tar.hs +2/−2
- Codec/Archive/Tar/Types.hs +26/−0
- Codec/Archive/Tar/Unpack.hs +5/−5
- changelog.md +5/−0
- tar-bytestring.cabal +2/−2
Codec/Archive/Tar.hs view
@@ -206,7 +206,7 @@ -> [RawFilePath] -- ^ Files and directories to archive, relative to base dir -> IO () create tar base paths =- writeFileL tar (Just newFilePerms) . write =<< pack base paths+ writeFileL tar (Just filePerms) . write =<< pack base paths -- | Extract all the files contained in a @\".tar\"@ file. --@@ -253,7 +253,7 @@ -> IO () append tar base paths = do handle <-- bracketOnError (openFd tar ReadWrite [] (Just newFilePerms)) (SPI.closeFd)+ bracketOnError (openFd tar ReadWrite [] (Just filePerms)) (SPI.closeFd) $ SPI.fdToHandle finally (action handle) (hClose handle)
Codec/Archive/Tar/Types.hs view
@@ -53,6 +53,9 @@ foldlEntries, unfoldEntries, + filePerms,+ dirPerms,+ #ifdef TESTS limitToV7FormatCompat #endif@@ -68,6 +71,7 @@ import System.Posix.ByteString.FilePath (RawFilePath) import qualified System.Posix.FilePath as FilePath.Posix+import System.Posix.Files.ByteString import System.Posix.Types ( FileMode ) #ifdef TESTS@@ -110,6 +114,28 @@ entryFormat :: !Format } deriving (Eq, Show)++++-- |Default permissions for tar regular files.+filePerms :: FileMode+filePerms =+ ownerWriteMode+ `unionFileModes` ownerReadMode+ `unionFileModes` groupWriteMode+ `unionFileModes` groupReadMode+ `unionFileModes` otherWriteMode+ `unionFileModes` otherReadMode+++-- |Default permissions for tar directory.+dirPerms :: FileMode+dirPerms =+ ownerModes+ `unionFileModes` groupModes+ `unionFileModes` otherExecuteMode+ `unionFileModes` otherReadMode+ -- | Native 'FilePath' of the file or directory within the archive. --
Codec/Archive/Tar/Unpack.hs view
@@ -75,7 +75,7 @@ unpackEntries _ (Fail err) = either throwIO throwIO err unpackEntries links Done = return links unpackEntries links (Next entry es) = case entryContent entry of- NormalFile file _ -> extractFile path file mtime+ NormalFile file _ -> extractFile entry path file mtime >> unpackEntries links es Directory -> extractDir path mtime >> unpackEntries links es@@ -86,19 +86,19 @@ path = entryPath entry mtime = entryTime entry - extractFile path content mtime = do+ extractFile entry path content mtime = do -- Note that tar archives do not make sure each directory is created -- before files they contain, indeed we may have to create several -- levels of directory.- createDirRecursive newDirPerms (normalise absDir)- writeFileL absPath (Just newFilePerms) content+ createDirRecursive dirPerms (normalise absDir)+ writeFileL absPath (Just $ entryPermissions entry) content setModTime absPath mtime where absDir = baseDir </> FilePath.Native.takeDirectory path absPath = baseDir </> path extractDir path mtime = do- createDirRecursive newDirPerms (normalise absPath)+ createDirRecursive dirPerms (normalise absPath) setModTime absPath mtime where absPath = baseDir </> path
changelog.md view
@@ -1,5 +1,10 @@ See also http://pvp.haskell.org/faq +0.6.2.0++ * fix executable bit: https://github.com/haskell/tar/issues/25+ * fix default permissions for directories (also set write for group)+ 0.6.1.3 * fix bug in 'unpack'
tar-bytestring.cabal view
@@ -1,5 +1,5 @@ name: tar-bytestring-version: 0.6.1.3+version: 0.6.2.0 license: BSD3 license-file: LICENSE author: Duncan Coutts <duncan@community.haskell.org>@@ -44,7 +44,7 @@ time >= 1.8, containers >= 0.2 && < 0.7, deepseq >= 1.1 && < 1.5,- hpath-directory >= 0.13.1 && < 0.14,+ hpath-directory >= 0.13.2 && < 0.14, hpath-filepath >= 0.10.4 && < 0.11, hpath-posix >= 0.13.1 && < 0.14, safe-exceptions >= 0.1,