Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove v1-update #7151

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ executable cabal
Distribution.Client.Types.SourcePackageDb
Distribution.Client.Types.SourceRepo
Distribution.Client.Types.WriteGhcEnvironmentFilesPolicy
Distribution.Client.Update
Distribution.Client.Upload
Distribution.Client.Utils
Distribution.Client.Utils.Json
Expand Down
1 change: 0 additions & 1 deletion cabal-install/cabal-install.cabal.dev
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ library cabal-lib-client
Distribution.Client.Types.SourcePackageDb
Distribution.Client.Types.SourceRepo
Distribution.Client.Types.WriteGhcEnvironmentFilesPolicy
Distribution.Client.Update
Distribution.Client.Upload
Distribution.Client.Utils
Distribution.Client.Utils.Json
Expand Down
1 change: 0 additions & 1 deletion cabal-install/cabal-install.cabal.prod
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ executable cabal
Distribution.Client.Types.SourcePackageDb
Distribution.Client.Types.SourceRepo
Distribution.Client.Types.WriteGhcEnvironmentFilesPolicy
Distribution.Client.Update
Distribution.Client.Upload
Distribution.Client.Utils
Distribution.Client.Utils.Json
Expand Down
1 change: 0 additions & 1 deletion cabal-install/cabal-install.cabal.zinza
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ Version: 3.5.0.0
Distribution.Client.Types.SourcePackageDb
Distribution.Client.Types.SourceRepo
Distribution.Client.Types.WriteGhcEnvironmentFilesPolicy
Distribution.Client.Update
Distribution.Client.Upload
Distribution.Client.Utils
Distribution.Client.Utils.Json
Expand Down
13 changes: 0 additions & 13 deletions cabal-install/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import Distribution.Client.Setup
, GetFlags(..), getCommand, unpackCommand
, checkCommand
, formatCommand
, UpdateFlags(..), updateCommand
, ListFlags(..), listCommand, listNeedsCompiler
, InfoFlags(..), infoCommand
, UploadFlags(..), uploadCommand
Expand Down Expand Up @@ -95,7 +94,6 @@ import Distribution.Client.CmdLegacy

import Distribution.Client.Install (install)
import Distribution.Client.Configure (configure, writeConfigFlags)
import Distribution.Client.Update (update)
import Distribution.Client.Exec (exec)
import Distribution.Client.Fetch (fetch)
import Distribution.Client.Freeze (freeze)
Expand Down Expand Up @@ -270,7 +268,6 @@ mainWorker args = do
, newCmd CmdSdist.sdistCommand CmdSdist.sdistAction

, legacyCmd configureExCommand configureAction
, legacyCmd updateCommand updateAction
, legacyCmd buildCommand buildAction
, legacyCmd replCommand replAction
, legacyCmd freezeCommand freezeAction
Expand Down Expand Up @@ -746,16 +743,6 @@ infoAction infoFlags extraArgs globalFlags = do
infoFlags
targets

updateAction :: UpdateFlags -> [String] -> Action
updateAction updateFlags extraArgs globalFlags = do
let verbosity = fromFlag (updateVerbosity updateFlags)
unless (null extraArgs) $
die' verbosity $ "'update' doesn't take any extra arguments: " ++ unwords extraArgs
config <- loadConfigOrSandboxConfig verbosity globalFlags
let globalFlags' = savedGlobalFlags config `mappend` globalFlags
withRepoContext verbosity globalFlags' $ \repoContext ->
update verbosity updateFlags repoContext

fetchAction :: FetchFlags -> [String] -> Action
fetchAction fetchFlags extraArgs globalFlags = do
let verbosity = fromFlag (fetchVerbosity fetchFlags)
Expand Down
30 changes: 1 addition & 29 deletions cabal-install/src/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Distribution.Client.Setup
, filterHaddockArgs, filterHaddockFlags, haddockOptions
, defaultSolver, defaultMaxBackjumps
, listCommand, ListFlags(..), listNeedsCompiler
, updateCommand, UpdateFlags(..), defaultUpdateFlags
,UpdateFlags(..), defaultUpdateFlags
, infoCommand, InfoFlags(..)
, fetchCommand, FetchFlags(..)
, freezeCommand, FreezeFlags(..)
Expand Down Expand Up @@ -1261,34 +1261,6 @@ defaultUpdateFlags
updateIndexState = toFlag headTotalIndexState
}

updateCommand :: CommandUI UpdateFlags
updateCommand = CommandUI {
commandName = "update",
commandSynopsis = "Updates list of known packages.",
commandDescription = Just $ \_ ->
"For all known remote repositories, download the package list.\n",
commandNotes = Just $ \_ ->
relevantConfigValuesText ["remote-repo"
,"remote-repo-cache"
,"local-repo"],
commandUsage = usageFlags "v1-update",
commandDefaultFlags = defaultUpdateFlags,
commandOptions = \_ -> [
optionVerbosity updateVerbosity (\v flags -> flags { updateVerbosity = v }),
option [] ["index-state"]
("Update the source package index to its state as it existed at a previous time. " ++
"Accepts unix-timestamps (e.g. '@1474732068'), ISO8601 UTC timestamps " ++
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD' (default: 'HEAD').")
updateIndexState (\v flags -> flags { updateIndexState = v })
(reqArg "STATE" (parsecToReadE (const $ "index-state must be a " ++
"unix-timestamps (e.g. '@1474732068'), " ++
"a ISO8601 UTC timestamp " ++
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD'")
(toFlag `fmap` parsec))
(flagToList . fmap prettyShow))
]
}

-- ------------------------------------------------------------
-- * Other commands
-- ------------------------------------------------------------
Expand Down
117 changes: 0 additions & 117 deletions cabal-install/src/Distribution/Client/Update.hs

This file was deleted.