File tree Expand file tree Collapse file tree 4 files changed +21
-18
lines changed Expand file tree Collapse file tree 4 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ test-suite hackage-tests
155
155
, base-orphans >= 0.6 && < 0.10
156
156
, clock >= 0.8 && < 0.9
157
157
, optparse-applicative >= 0.13.2.0 && < 0.19
158
- , tar >= 0.5.0.3 && < 0.7
158
+ , tar >= 0.5.0.3 && < 0.8
159
159
, tree-diff >= 0.1 && < 0.4
160
160
161
161
ghc-options : -Wall -rtsopts -threaded
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ library
250
250
, process >= 1.2.3.0 && < 1.7
251
251
, random >= 1.2 && < 1.4
252
252
, stm >= 2.0 && < 2.6
253
- , tar >= 0.5.0.3 && < 0.7
253
+ , tar >= 0.5.0.3 && < 0.8
254
254
, time >= 1.5.0.1 && < 1.16
255
255
, zlib >= 0.5.3 && < 0.8
256
256
, hackage-security >= 0.6.2.0 && < 0.7
Original file line number Diff line number Diff line change 4
4
{- FOURMOLU_DISABLE -}
5
5
module Distribution.Client.Compat.Tar
6
6
( extractTarGzFile
7
+ , createTarGzFile
7
8
#if MIN_VERSION_tar(0,6,0)
8
9
, Tar. Entry
9
10
, Tar. Entries
@@ -27,6 +28,7 @@ import qualified Codec.Archive.Tar.Check as Tar
27
28
#else
28
29
import qualified Codec.Archive.Tar.Entry as Tar
29
30
#endif
31
+ import qualified Codec.Compression.GZip as GZip
30
32
import qualified Data.ByteString.Lazy as BS
31
33
import qualified Distribution.Client.GZipUtils as GZipUtils
32
34
@@ -65,4 +67,20 @@ extractTarGzFile dir expected tar =
65
67
. Tar. read
66
68
. GZipUtils. maybeDecompress
67
69
=<< BS. readFile tar
70
+
71
+ createTarGzFile
72
+ :: FilePath
73
+ -- ^ Full Tarball path
74
+ -> FilePath
75
+ -- ^ Base directory
76
+ -> FilePath
77
+ -- ^ Directory to archive, relative to base dir
78
+ -> IO ()
79
+ createTarGzFile tar base dir =
80
+ #if MIN_VERSION_tar(0,7,0)
81
+ BS. writeFile tar . GZip. compress =<< Tar. write' =<< Tar. pack' base [dir]
82
+ #else
83
+ BS. writeFile tar . GZip. compress . Tar. write =<< Tar. pack base [dir]
84
+ #endif
85
+
68
86
{- FOURMOLU_ENABLE -}
Original file line number Diff line number Diff line change 17
17
-- Reading, writing and manipulating \"@.tar@\" archive files.
18
18
module Distribution.Client.Tar
19
19
( -- * @tar.gz@ operations
20
- createTarGzFile
20
+ TarComp. createTarGzFile
21
21
, TarComp. extractTarGzFile
22
22
23
23
-- * Other local utils
@@ -34,8 +34,6 @@ import Prelude ()
34
34
35
35
import qualified Codec.Archive.Tar as Tar
36
36
import qualified Codec.Archive.Tar.Entry as Tar
37
- import qualified Codec.Compression.GZip as GZip
38
- import qualified Data.ByteString.Lazy as BS
39
37
import qualified Distribution.Client.Compat.Tar as TarComp
40
38
41
39
-- for foldEntries...
@@ -45,19 +43,6 @@ import Control.Exception (throw)
45
43
46
44
-- * High level operations
47
45
48
- --
49
-
50
- createTarGzFile
51
- :: FilePath
52
- -- ^ Full Tarball path
53
- -> FilePath
54
- -- ^ Base directory
55
- -> FilePath
56
- -- ^ Directory to archive, relative to base dir
57
- -> IO ()
58
- createTarGzFile tar base dir =
59
- BS. writeFile tar . GZip. compress . Tar. write =<< Tar. pack base [dir]
60
-
61
46
-- | Type code for the local build tree reference entry type. We don't use the
62
47
-- symbolic link entry type because it allows only 100 ASCII characters for the
63
48
-- path.
You can’t perform that action at this time.
0 commit comments