From f61b0568f18c30c2a45dcda2b387cd4466c18718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20L=C3=A4ll?= Date: Tue, 5 May 2026 10:51:28 +0300 Subject: [PATCH 1/3] Prefix comment with "TODO" --- cabal-install/src/Distribution/Client/Types/Repo.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal-install/src/Distribution/Client/Types/Repo.hs b/cabal-install/src/Distribution/Client/Types/Repo.hs index 4b6b19cbc6c..40135c18f38 100644 --- a/cabal-install/src/Distribution/Client/Types/Repo.hs +++ b/cabal-install/src/Distribution/Client/Types/Repo.hs @@ -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 From 46c4c9db6d580e716faa5a28018ff6e8fd3572e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20L=C3=A4ll?= Date: Tue, 5 May 2026 19:07:00 +0300 Subject: [PATCH 2/3] Don't pass unused argument --- cabal-install/src/Distribution/Client/CmdUpdate.hs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cabal-install/src/Distribution/Client/CmdUpdate.hs b/cabal-install/src/Distribution/Client/CmdUpdate.hs index 0c4d891eb79..e57eb6af18d 100644 --- a/cabal-install/src/Distribution/Client/CmdUpdate.hs +++ b/cabal-install/src/Distribution/Client/CmdUpdate.hs @@ -52,8 +52,6 @@ import Distribution.Client.ProjectOrchestration import Distribution.Client.Setup ( GlobalFlags , RepoContext (..) - , UpdateFlags - , defaultUpdateFlags ) import Distribution.Client.Types ( RemoteRepo (..) @@ -212,7 +210,7 @@ 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 @@ -220,13 +218,8 @@ updateAction flags@NixStyleFlags{..} extraArgs globalFlags = do 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 +updateRepo :: Verbosity -> RepoContext -> (Repo, RepoIndexState) -> IO () +updateRepo verbosity repoCtxt (repo, indexState) = do transport <- repoContextGetTransport repoCtxt case repo of RepoLocalNoIndex{} -> do From 78c80d8835dc7645529dbf02e5873f1904c8884a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20L=C3=A4ll?= Date: Tue, 5 May 2026 19:16:12 +0300 Subject: [PATCH 3/3] Query for `transport` only in the case that it's needed --- cabal-install/src/Distribution/Client/CmdUpdate.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal-install/src/Distribution/Client/CmdUpdate.hs b/cabal-install/src/Distribution/Client/CmdUpdate.hs index e57eb6af18d..c4033da32c8 100644 --- a/cabal-install/src/Distribution/Client/CmdUpdate.hs +++ b/cabal-install/src/Distribution/Client/CmdUpdate.hs @@ -220,12 +220,12 @@ updateAction flags@NixStyleFlags{..} extraArgs globalFlags = do updateRepo :: Verbosity -> RepoContext -> (Repo, RepoIndexState) -> IO () updateRepo verbosity repoCtxt (repo, indexState) = do - transport <- repoContextGetTransport repoCtxt case repo of RepoLocalNoIndex{} -> do let index = RepoIndex repoCtxt repo updatePackageIndexCacheFile verbosity index RepoRemote{..} -> do + transport <- repoContextGetTransport repoCtxt downloadResult <- downloadIndex transport