Skip to content

Commit

Permalink
Remove 'upload --check'.
Browse files Browse the repository at this point in the history
  • Loading branch information
23Skidoo committed May 11, 2016
1 parent fe0a4aa commit 5ddd497
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion cabal-install/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ instance Semigroup SavedConfig where

combinedSavedUploadFlags = UploadFlags {
uploadCandidate = combine uploadCandidate,
uploadCheck = combine uploadCheck,
uploadDoc = combine uploadDoc,
uploadUsername = combine uploadUsername,
uploadPassword = combine uploadPassword,
Expand Down
7 changes: 0 additions & 7 deletions cabal-install/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,6 @@ instance Semigroup InstallFlags where

data UploadFlags = UploadFlags {
uploadCandidate :: Flag Bool,
uploadCheck :: Flag Bool,
uploadDoc :: Flag Bool,
uploadUsername :: Flag Username,
uploadPassword :: Flag Password,
Expand All @@ -1439,7 +1438,6 @@ data UploadFlags = UploadFlags {
defaultUploadFlags :: UploadFlags
defaultUploadFlags = UploadFlags {
uploadCandidate = toFlag True,
uploadCheck = toFlag False,
uploadDoc = toFlag False,
uploadUsername = mempty,
uploadPassword = mempty,
Expand All @@ -1466,11 +1464,6 @@ uploadCommand = CommandUI {
uploadCandidate (\v flags -> flags { uploadCandidate = v })
falseArg

,option ['c'] ["check"]
"Do not upload, just do QA checks."
uploadCheck (\v flags -> flags { uploadCheck = v })
trueArg

,option ['d'] ["documentation"]
"Upload documentation instead of a source package. Cannot be used together with --check. \
\By default, this uploads documentation for a package candidate. To upload documentation for \
Expand Down
15 changes: 2 additions & 13 deletions cabal-install/Distribution/Client/Upload.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Distribution.Client.Upload (check, upload, uploadDoc, report) where
module Distribution.Client.Upload (upload, uploadDoc, report) where

import Distribution.Client.Types ( Username(..), Password(..)
, RemoteRepo(..), maybeRepoRemote )
Expand All @@ -15,7 +15,7 @@ import Distribution.Client.Config
import qualified Distribution.Client.BuildReports.Anonymous as BuildReport
import qualified Distribution.Client.BuildReports.Upload as BuildReport

import Network.URI (URI(uriPath), parseURI)
import Network.URI (URI(uriPath))
import Network.HTTP (Header(..), HeaderName(..))

import System.IO (hFlush, stdin, stdout, hGetEcho, hSetEcho)
Expand All @@ -30,10 +30,6 @@ import Data.Char (isSpace)

type Auth = Maybe (String, String)

checkURI :: URI
Just checkURI = parseURI $ "http://hackage.haskell.org/cgi-bin/"
++ "hackage-scripts/check-pkg"

stripExtensions :: [String] -> FilePath -> Maybe String
stripExtensions exts path = foldM f path (reverse exts)
where
Expand Down Expand Up @@ -170,13 +166,6 @@ report verbosity repoCtxt mUsername mPassword = do
(remoteRepoURI remoteRepo) [(report', Just buildLog)]
return ()

check :: Verbosity -> RepoContext -> [FilePath] -> IO ()
check verbosity repoCtxt paths = do
transport <- repoContextGetTransport repoCtxt
forM_ paths $ \path -> do
notice verbosity $ "Checking " ++ path ++ "... "
handlePackage transport verbosity checkURI checkURI Nothing False path

handlePackage :: HttpTransport -> Verbosity -> URI -> URI -> Auth
-> Bool -> FilePath -> IO ()
handlePackage transport verbosity uri packageUri auth candidate path =
Expand Down
8 changes: 1 addition & 7 deletions cabal-install/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,9 +1054,6 @@ uploadAction uploadFlags extraArgs globalFlags = do
tarfiles = extraArgs
when (null tarfiles && not (fromFlag (uploadDoc uploadFlags'))) $
die "the 'upload' command expects at least one .tar.gz archive."
when (fromFlag (uploadCheck uploadFlags')
&& fromFlag (uploadDoc uploadFlags')) $
die "--check and --doc cannot be used together."
checkTarFiles extraArgs
maybe_password <-
case uploadPasswordCmd uploadFlags'
Expand All @@ -1065,10 +1062,7 @@ uploadAction uploadFlags extraArgs globalFlags = do
(simpleProgramInvocation xs xss)
_ -> pure $ flagToMaybe $ uploadPassword uploadFlags'
withRepoContext verbosity globalFlags' $ \repoContext -> do
if fromFlag (uploadCheck uploadFlags')
then do
Upload.check verbosity repoContext tarfiles
else if fromFlag (uploadDoc uploadFlags')
if fromFlag (uploadDoc uploadFlags')
then do
when (length tarfiles > 1) $
die $ "the 'upload' command can only upload documentation "
Expand Down

0 comments on commit 5ddd497

Please sign in to comment.