Skip to content
Commits on Source (3)
......@@ -90,7 +90,7 @@ cabal-debian 4.38.5 binary -f-local-debian key
cabal-doctest 1.0.6
cabal-file-th 0.2.4 ignore # BROKEN: see https://bugs.debian.org/911570
cabal-helper 0.8.1.2 ignore # BROKEN: LTS 12: pretty-show (>=1.8.1)
cabal-install 2.4.1.0 binary
cabal-install 2.4.0.0 binary behind
cabal-plan 0.4.0.0
cairo 0.13.5.0
call-stack 0.1.0 notest
......@@ -1073,4 +1073,4 @@ zeromq4-haskell 0.7.0 notest
zip-archive 0.4.1
zlib 0.6.2 notest
zlib-bindings 0.1.1.5
zxcvbn-c 1.0.1
zxcvbn-c 1.0.1 ignore # constraint from maximum version of Cabal used by Setup.hs requires <2.4
From 8217174d13c801d171d5f7e337f4bd77596cc530 Mon Sep 17 00:00:00 2001
From: Emily Pillmore <emily@kadena.io>
Date: Fri, 30 Nov 2018 23:06:05 -0500
Subject: [PATCH] remove zip format code, zip-archive dependency, redundant +
unused imports
Index: b/Distribution/Client/CmdSdist.hs
===================================================================
--- a/Distribution/Client/CmdSdist.hs
+++ b/Distribution/Client/CmdSdist.hs
@@ -58,20 +58,17 @@ import Distribution.Verbosity
import qualified Codec.Archive.Tar as Tar
import qualified Codec.Archive.Tar.Entry as Tar
-import qualified Codec.Archive.Zip as Zip
import qualified Codec.Compression.GZip as GZip
import Control.Exception
( throwIO )
import Control.Monad
- ( when, forM, forM_ )
+ ( when, forM_ )
import Control.Monad.Trans
( liftIO )
import Control.Monad.State.Lazy
( StateT, modify, gets, evalStateT )
import Control.Monad.Writer.Lazy
( WriterT, tell, execWriterT )
-import Data.Bits
- ( shiftL )
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.Either
@@ -119,8 +116,7 @@ sdistCommand = CommandUI
(choiceOpt
[ (Flag TargzFormat, ([], ["targz"]),
"Produce a '.tar.gz' format archive (default and required for uploading to hackage)")
- , (Flag ZipFormat, ([], ["zip"]),
- "Produce a '.zip' format archive")
+ -- ...
]
)
, option ['o'] ["output-dir", "outputdir"]
@@ -188,7 +184,6 @@ sdistAction SdistFlags{..} targetStrings
ext = case format of
SourceList _ -> "list"
Archive TargzFormat -> "tar.gz"
- Archive ZipFormat -> "zip"
outputPath pkg = case mOutputPath' of
Just path
@@ -274,20 +269,7 @@ packageToSdist verbosity projectRootDir
write . normalize . GZip.compress . Tar.write $ entries
when (outputFile /= "-") $
notice verbosity $ "Wrote tarball sdist to " ++ outputFile ++ "\n"
- Archive ZipFormat -> do
- let prefix = prettyShow (packageId pkg)
- entries <- forM files $ \(perm, file) -> do
- let perm' = case perm of
- -- -rwxr-xr-x
- Exec -> 0o010755 `shiftL` 16
- -- -rw-r--r--
- NoExec -> 0o010644 `shiftL` 16
- contents <- BSL.readFile file
- return $ (Zip.toEntry (prefix </> file) 0 contents) { Zip.eExternalFileAttributes = perm' }
- let archive = foldr Zip.addEntryToArchive Zip.emptyArchive entries
- write (Zip.fromArchive archive)
- when (outputFile /= "-") $
- notice verbosity $ "Wrote zip sdist to " ++ outputFile ++ "\n"
+
setCurrentDirectory oldPwd
--
Index: b/Distribution/Client/DistDirLayout.hs
===================================================================
--- a/Distribution/Client/DistDirLayout.hs
+++ b/Distribution/Client/DistDirLayout.hs
@@ -230,8 +230,7 @@ defaultDistDirLayout projectRoot mdistDi
where
ext = case format of
TargzFormat -> "tar.gz"
- ZipFormat -> "zip"
-
+
distSdistDirectory = distDirectory </> "sdist"
distTempDirectory = distDirectory </> "tmp"
Index: b/Distribution/Client/Setup.hs
===================================================================
--- a/Distribution/Client/Setup.hs
+++ b/Distribution/Client/Setup.hs
@@ -2298,7 +2298,7 @@ data SDistExFlags = SDistExFlags {
}
deriving (Show, Generic)
-data ArchiveFormat = TargzFormat | ZipFormat -- ...
+data ArchiveFormat = TargzFormat -- ...
deriving (Show, Eq)
defaultSDistExFlags :: SDistExFlags
@@ -2325,8 +2325,7 @@ sdistCommand = Cabal.sdistCommand {
(choiceOpt
[ (Flag TargzFormat, ([], ["targz"]),
"Produce a '.tar.gz' format archive (default and required for uploading to hackage)")
- , (Flag ZipFormat, ([], ["zip"]),
- "Produce a '.zip' format archive")
+ -- ...
])
]
Index: b/Distribution/Client/SrcDist.hs
===================================================================
--- a/Distribution/Client/SrcDist.hs
+++ b/Distribution/Client/SrcDist.hs
@@ -24,15 +24,13 @@ import Distribution.PackageDescription.P
( readGenericPackageDescription )
import Distribution.Simple.Utils
( createDirectoryIfMissingVerbose, defaultPackageDesc
- , warn, die', notice, withTempDirectory )
+ , warn, notice, withTempDirectory )
import Distribution.Client.Setup
( SDistFlags(..), SDistExFlags(..), ArchiveFormat(..) )
import Distribution.Simple.Setup
( Flag(..), sdistCommand, flagToList, fromFlag, fromFlagOrDefault
, defaultSDistFlags )
import Distribution.Simple.BuildPaths ( srcPref)
-import Distribution.Simple.Program (requireProgram, simpleProgram, programPath)
-import Distribution.Simple.Program.Db (emptyProgramDb)
import Distribution.Text ( display )
import Distribution.Verbosity (Verbosity, normal, lessVerbose)
import Distribution.Version (mkVersion, orLaterVersion, intersectVersionRanges)
@@ -43,9 +41,7 @@ import Distribution.Compat.Exception
import System.FilePath ((</>), (<.>))
import Control.Monad (when, unless, liftM)
-import System.Directory (doesFileExist, removeFile, canonicalizePath, getTemporaryDirectory)
-import System.Process (runProcess, waitForProcess)
-import System.Exit (ExitCode(..))
+import System.Directory (getTemporaryDirectory)
import Control.Exception (IOException, evaluate)
-- |Create a source distribution.
@@ -103,7 +99,6 @@ sdist flags exflags = do
format = fromFlag (sDistFormat exflags)
createArchive = case format of
TargzFormat -> createTarGzArchive
- ZipFormat -> createZipArchive
tarBallName :: PackageDescription -> String
tarBallName = display . packageId
@@ -117,38 +112,6 @@ createTarGzArchive verbosity pkg tmpDir
where
tarBallFilePath = targetPref </> tarBallName pkg <.> "tar.gz"
--- | Create a zip archive from a tree of source files.
-createZipArchive :: Verbosity -> PackageDescription -> FilePath -> FilePath
- -> IO ()
-createZipArchive verbosity pkg tmpDir targetPref = do
- let dir = tarBallName pkg
- zipfile = targetPref </> dir <.> "zip"
- (zipProg, _) <- requireProgram verbosity zipProgram emptyProgramDb
-
- -- zip has an annoying habit of updating the target rather than creating
- -- it from scratch. While that might sound like an optimisation, it doesn't
- -- remove files already in the archive that are no longer present in the
- -- uncompressed tree.
- alreadyExists <- doesFileExist zipfile
- when alreadyExists $ removeFile zipfile
-
- -- We call zip with a different CWD, so have to make the path
- -- absolute. Can't just use 'canonicalizePath zipfile' since this function
- -- requires its argument to refer to an existing file.
- zipfileAbs <- fmap (</> dir <.> "zip") . canonicalizePath $ targetPref
-
- --TODO: use runProgramInvocation, but has to be able to set CWD
- hnd <- runProcess (programPath zipProg) ["-q", "-r", zipfileAbs, dir]
- (Just tmpDir)
- Nothing Nothing Nothing Nothing
- exitCode <- waitForProcess hnd
- unless (exitCode == ExitSuccess) $
- die' verbosity $ "Generating the zip file failed "
- ++ "(zip returned exit code " ++ show exitCode ++ ")"
- notice verbosity $ "Source zip archive created: " ++ zipfile
- where
- zipProgram = simpleProgram "zip"
-
-- | List all source files of a given add-source dependency. Exits with error if
-- something is wrong (e.g. there is no .cabal file in the given directory).
allPackageSourceFiles :: Verbosity -> SetupScriptOptions -> FilePath
Index: b/cabal-install.cabal
===================================================================
--- a/cabal-install.cabal
+++ b/cabal-install.cabal
@@ -326,7 +326,6 @@ executable cabal
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.5.2.2 && < 0.6,
text >= 1.2.3 && < 1.3,
- zip-archive >= 0.3.2.5 && < 0.4,
parsec >= 3.1.13.0 && < 3.2
if flag(native-dns)
......@@ -377,9 +377,9 @@ for my $group (sort @groups) {
#"-v",
"--config-file",
"$sandboxdir/config",
"--ghc-pkg-option=--global-package-db=$dbpath",
"--global",
"install",
"new-install",
"--package-db=clear",
"--package-db=$dbpath",
"--dry-run",
"--force-reinstall",
"--max-backjumps",
......