Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
38189542
Commit
38189542
authored
Oct 07, 2007
by
bjorn@bringert.net
Browse files
Replace zlib use by compression.
parent
de2fbfaa
Changes
4
Hide whitespace changes
Inline
Side-by-side
cabal-install/TODO
View file @
38189542
...
...
@@ -7,5 +7,3 @@
- Overhaul verbosity
- Figure out command-line interface
- Get rid of zlib dependency
cabal-install/cabal-install.cabal
View file @
38189542
...
...
@@ -15,7 +15,7 @@ Build-depends: base, mtl, network, regex-compat,
filepath >= 1.0,
Cabal>=1.3,
HTTP >= 3000.0 && < 3000.1,
zlib
>= 0.
3
compression
>= 0.
1
Extra-Source-Files: copyright README
Executable: cabal-install
...
...
cabal-install/src/Network/Hackage/CabalInstall/Tar.hs
View file @
38189542
-- | Simplistic TAR archive reading. Only gets the file names and file contents.
module
Network.Hackage.CabalInstall.Tar
(
TarHeader
(
..
),
TarFileType
(
..
),
readTarArchive
,
extractTarArchive
,
extractTarGzFile
)
where
extractTarGzFile
,
gunzip
)
where
import
qualified
Data.ByteString.Lazy.Char8
as
BS
import
Data.ByteString.Lazy.Char8
(
ByteString
)
...
...
@@ -15,7 +15,8 @@ import System.Directory (Permissions(..), setPermissions, createDirectoryIfMissi
import
System.FilePath
((
</>
),
isValid
,
isAbsolute
)
import
System.Posix.Types
(
FileMode
)
import
Codec.Compression.GZip
(
decompress
)
--import Codec.Compression.GZip (decompress)
import
Codec.Compression.GZip.GUnZip
(
gunzip
)
data
TarHeader
=
TarHeader
{
tarFileName
::
FilePath
,
...
...
@@ -43,7 +44,7 @@ extractTarGzFile :: Maybe FilePath -- ^ Destination directory
->
FilePath
-- ^ Tarball
->
IO
()
extractTarGzFile
mdir
file
=
BS
.
readFile
file
>>=
extractTarArchive
mdir
.
readTarArchive
.
decompress
BS
.
readFile
file
>>=
extractTarArchive
mdir
.
readTarArchive
.
gunzip
--
-- * Extracting
...
...
cabal-install/src/Network/Hackage/CabalInstall/Update.hs
View file @
38189542
...
...
@@ -17,13 +17,13 @@ module Network.Hackage.CabalInstall.Update
import
Network.Hackage.CabalInstall.Types
(
ConfigFlags
(
..
),
PkgInfo
(
..
),
Repo
(
..
))
import
Network.Hackage.CabalInstall.Utils
(
isVerbose
)
import
Network.Hackage.CabalInstall.Fetch
(
downloadIndex
,
packagesDirectory
)
import
Network.Hackage.CabalInstall.Tar
(
gunzip
)
import
Distribution.Package
(
PackageIdentifier
(
..
),
pkgName
,
showPackageId
)
import
Distribution.PackageDescription
(
PackageDescription
(
..
),
readPackageDescription
,
GenericPackageDescription
(
..
))
import
Distribution.Verbosity
import
System.FilePath
((
</>
),
joinPath
,
addExtension
,
takeExtension
,
dropExtension
)
import
Codec.Compression.GZip
(
decompress
)
import
Control.Monad
(
liftM
,
when
)
import
qualified
Data.ByteString.Lazy.Char8
as
BS
import
Data.ByteString.Lazy.Char8
(
ByteString
)
...
...
@@ -41,4 +41,4 @@ updateRepo :: ConfigFlags
updateRepo
cfg
repo
=
do
printf
"Downloading package list from server '%s'
\n
"
(
repoURL
repo
)
indexPath
<-
downloadIndex
cfg
repo
BS
.
readFile
indexPath
>>=
BS
.
writeFile
(
dropExtension
indexPath
)
.
decompress
BS
.
readFile
indexPath
>>=
BS
.
writeFile
(
dropExtension
indexPath
)
.
gunzip
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment