packages feed

tar 0.3.1.0 → 0.3.2.0

raw patch · 9 files changed

+34/−33 lines, 9 filesdep ~base

Dependency ranges changed: base

Files

Codec/Archive/Tar.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -- Reading, writing and manipulating \"@.tar@\" archive files.@@ -132,7 +132,7 @@ import Codec.Archive.Tar.Pack import Codec.Archive.Tar.Unpack -import Codec.Archive.Tar.Check+import Codec.Archive.Tar.Check ()  import qualified Data.ByteString.Lazy as BS import Prelude hiding (read)
Codec/Archive/Tar/Check.hs view
@@ -4,7 +4,7 @@ -- Copyright   :  (c) 2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -- Perform various checks on tar file entries.@@ -97,9 +97,9 @@   | not (FilePath.Windows.isValid windowsPath)   = Just $ "Invalid windows file name in tar archive: " ++ show windowsPath -  | not (FilePath.Posix.isAbsolute posixPath)+  | FilePath.Posix.isAbsolute posixPath   = Just $ "Absolute unix file name in tar archive: " ++ show posixPath-  | not (FilePath.Windows.isAbsolute windowsPath)+  | FilePath.Windows.isAbsolute windowsPath   = Just $ "Absolute windows file name in tar archive: " ++ show windowsPath    | any (=="..") (FilePath.Posix.splitDirectories posixPath)
Codec/Archive/Tar/Entry.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -- Types and functions to manipulate tar entries.
Codec/Archive/Tar/Pack.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -----------------------------------------------------------------------------@@ -24,12 +24,10 @@ import System.FilePath          ( (</>) ) import qualified System.FilePath as FilePath.Native-         ( makeRelative, addTrailingPathSeparator, hasTrailingPathSeparator )+         ( addTrailingPathSeparator, hasTrailingPathSeparator ) import System.Directory          ( getDirectoryContents, doesDirectoryExist, getModificationTime          , Permissions(..), getPermissions )-import System.Posix.Types-         ( FileMode ) import System.Time          ( ClockTime(..) ) import System.IO
Codec/Archive/Tar/Read.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -----------------------------------------------------------------------------@@ -17,7 +17,6 @@ import Data.Char     (ord) import Data.Int      (Int64) import Numeric       (readOct)-import Control.Monad (unless)  import qualified Data.ByteString.Lazy as BS import qualified Data.ByteString.Lazy.Char8 as BS.Char8
Codec/Archive/Tar/Types.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -- Types to represent the content of @.tar@ archives.@@ -56,7 +56,6 @@ import Data.Int      (Int64) import Data.Monoid   (Monoid(..)) import qualified Data.ByteString.Lazy as BS-import qualified Data.ByteString.Lazy.Char8 as BS.Char8 import Data.ByteString.Lazy (ByteString)  import qualified System.FilePath as FilePath.Native
Codec/Archive/Tar/Unpack.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -----------------------------------------------------------------------------@@ -21,7 +21,7 @@ import System.FilePath          ( (</>) ) import qualified System.FilePath as FilePath.Native-         ( (</>), takeDirectory )+         ( takeDirectory ) import System.Directory          ( createDirectoryIfMissing, copyFile ) @@ -54,6 +54,9 @@                      >>= emulateLinks    where+    -- We're relying here on 'checkSecurity' to make sure we're not scribbling+    -- files all over the place.+     unpackEntries _     (Fail err)      = fail err     unpackEntries links Done            = return links     unpackEntries links (Next entry es) = case entryContent entry of@@ -68,13 +71,16 @@         path = entryPath entry      extractFile path content = do-      createDirectoryIfMissing False absDir+      -- 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.+      createDirectoryIfMissing True absDir       BS.writeFile absPath content       where         absDir  = baseDir </> FilePath.Native.takeDirectory path         absPath = baseDir </> path -    extractDir path = createDirectoryIfMissing False (baseDir </> path)+    extractDir path = createDirectoryIfMissing True (baseDir </> path)      saveLink path link links = seq (length path)                              $ seq (length link')
Codec/Archive/Tar/Write.hs view
@@ -6,7 +6,7 @@ --                    2008-2009 Duncan Coutts -- License     :  BSD3 ----- Maintainer  :  duncan@haskell.org+-- Maintainer  :  duncan@community.haskell.org -- Portability :  portable -- -----------------------------------------------------------------------------@@ -119,7 +119,7 @@ putString n s = take n s ++ fill (n - length s) '\NUL'  --TODO: check integer widths, eg for large file sizes-putOct :: Integral a => FieldWidth -> a -> String+putOct :: (Integral a, Show a) => FieldWidth -> a -> String putOct n x =   let octStr = take (n-1) $ showOct x ""    in fill (n - length octStr - 1) '0'
tar.cabal view
@@ -1,12 +1,12 @@ name:            tar-version:         0.3.1.0+version:         0.3.2.0 license:         BSD3-license-File:    LICENSE+license-file:    LICENSE author:          Bjorn Bringert <bjorn@bringert.net>-                 Duncan Coutts <duncan@haskell.org>-maintainer:      Duncan Coutts <duncan@haskell.org>+                 Duncan Coutts <duncan@community.haskell.org>+maintainer:      Duncan Coutts <duncan@community.haskell.org> copyright:       2007 Bjorn Bringert <bjorn@bringert.net>-                 2008-2009 Duncan Coutts <duncan@haskell.org>+                 2008-2012 Duncan Coutts <duncan@community.haskell.org> category:        Codec synopsis:        Reading, writing and manipulating ".tar" archive files. description:     This library is for working with \"@.tar@\" archive files. It@@ -17,16 +17,15 @@                  details like file ownership and exact permissions are not                  preserved. build-type:      Simple-cabal-version:   >=1.2+cabal-version:   >=1.8 -flag base3+source-repository head+  type: darcs+  location: http://code.haskell.org/tar/  library-  build-depends: base >= 2 && < 5, filepath-  if flag(base3)-    build-depends: base >= 3, directory, old-time, bytestring-  else-    build-depends: base < 3+  build-depends: base >= 3 && < 5, filepath,+                 directory, old-time, bytestring    exposed-modules:     Codec.Archive.Tar@@ -40,4 +39,4 @@     Codec.Archive.Tar.Pack     Codec.Archive.Tar.Unpack -  ghc-options: -Wall -fno-warn-unused-imports+  ghc-options: -Wall