archive-tar-bytestring 0.1.0.0 → 1.0.0.0
raw patch · 3 files changed
+20/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Archive.Tar: packFiles :: [FilePath] -> IO ByteString
- Archive.Tar: unpackToDir :: FilePath -> ByteString -> IO ()
+ Archive.Tar: packFilesRaw :: [FP] -> IO ByteString
+ Archive.Tar: toFP :: FilePath -> FP
+ Archive.Tar: type FP = RawFilePath
+ Archive.Tar: unpackToDirRaw :: FP -> ByteString -> IO ()
Files
- CHANGELOG.md +4/−0
- archive-tar-bytestring.cabal +4/−1
- src/Archive/Tar.cpphs +12/−8
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 1.0.0.0++ * Conform to archive-sig 1.0.0.0+ # 0.1.0.0 * Initial release
archive-tar-bytestring.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: archive-tar-bytestring-version: 0.1.0.0+version: 1.0.0.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2020 Vanessa McHale@@ -50,3 +50,6 @@ if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists++ if impl(ghc >=8.10)+ ghc-options: -Wunused-packages
src/Archive/Tar.cpphs view
@@ -2,11 +2,13 @@ module Archive.Tar ( Entry , Error+ , FP , writeArchiveBytes- , unpackToDir+ , unpackToDirRaw , readArchiveBytes- , packFiles+ , packFilesRaw , versionInfo+ , toFP ) where import Codec.Archive.Tar (Entries (..))@@ -23,9 +25,11 @@ type Error = Tar.FormatError -convertFilePath :: FilePath -> RawFilePath-convertFilePath = encodeUtf8 . T.pack+type FP = RawFilePath +toFP :: FilePath -> FP+toFP = encodeUtf8 . T.pack+ coerceToList :: Entries a -> Either a [Entry] coerceToList (Next e es) = (e :) <$> coerceToList es coerceToList Done = Right []@@ -37,11 +41,11 @@ readArchiveBytes :: BSL.ByteString -> Either Error [Entry] readArchiveBytes = coerceToList . Tar.read -unpackToDir :: FilePath -> BSL.ByteString -> IO ()-unpackToDir = Tar.read .@ Tar.unpack . convertFilePath+unpackToDirRaw :: FP -> BSL.ByteString -> IO ()+unpackToDirRaw = Tar.read .@ Tar.unpack -packFiles :: [FilePath] -> IO BSL.ByteString-packFiles = fmap Tar.write . Tar.pack "." . fmap convertFilePath+packFilesRaw :: [FP] -> IO BSL.ByteString+packFilesRaw = fmap Tar.write . Tar.pack "." versionInfo :: String versionInfo = "tar-bytestring: " ++ VERSION_tar_bytestring ++ "\narchive-tar-bytestring: " ++ V.showVersion P.version