Skip to content
Open
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
15 changes: 4 additions & 11 deletions cabal-install/src/Distribution/Client/CmdUpdate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ import Distribution.Client.ProjectOrchestration
import Distribution.Client.Setup
( GlobalFlags
, RepoContext (..)
, UpdateFlags
, defaultUpdateFlags
)
import Distribution.Client.Types
( RemoteRepo (..)
Expand Down Expand Up @@ -212,27 +210,22 @@ updateAction flags@NixStyleFlags{..} extraArgs globalFlags = do
unless (null reposToUpdate) $ do
jobCtrl <- newParallelJobControl (length reposToUpdate)
traverse_
(spawnJob jobCtrl . updateRepo verbosity defaultUpdateFlags repoCtxt)
(spawnJob jobCtrl . updateRepo verbosity repoCtxt)
reposToUpdate
traverse_ (\_ -> collectJob jobCtrl) reposToUpdate
where
verbosity = cfgVerbosity normal flags
cliConfig = commandLineFlagsToProjectConfig globalFlags flags mempty -- ClientInstallFlags, not needed here
globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig)

updateRepo
:: Verbosity
-> UpdateFlags
-> RepoContext
-> (Repo, RepoIndexState)
-> IO ()
updateRepo verbosity _updateFlags repoCtxt (repo, indexState) = do
transport <- repoContextGetTransport repoCtxt
updateRepo :: Verbosity -> RepoContext -> (Repo, RepoIndexState) -> IO ()
Comment thread
ffaf1 marked this conversation as resolved.
updateRepo verbosity repoCtxt (repo, indexState) = do
case repo of
RepoLocalNoIndex{} -> do
let index = RepoIndex repoCtxt repo
updatePackageIndexCacheFile verbosity index
RepoRemote{..} -> do
transport <- repoContextGetTransport repoCtxt
downloadResult <-
downloadIndex
transport
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/Types/Repo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ data Repo
-- Although this contains the same fields as 'RepoRemote', we use a separate
-- constructor to avoid confusing the two.
--
-- Not all access to a secure repo goes through the hackage-security
-- TODO: Not all access to a secure repo goes through the hackage-security
-- library currently; code paths that do not still make use of the
-- 'repoRemote' and 'repoLocalDir' fields directly.
RepoSecure
Expand Down
Loading