Skip to content

Commit b68e241

Browse files
committed
Refactor getPackageSourceHashes in cabal-install
There's already a total `repoName` function that avoids incomplete-record-selectors. In the case of RepoSecure, it returns the `remoteRepoName`.
1 parent c39731d commit b68e241

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,11 +1245,9 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do
12451245
| pkgid <- pkgids
12461246
]
12471247
| (repo, pkgids) <-
1248-
-- All Repos here are SecureRepos (and will have a name), so we're
1249-
-- sorting Justs
12501248
map (\grp@((repo, _) :| _) -> (repo, map snd (NE.toList grp)))
1251-
. NE.groupBy ((==) `on` (fmap remoteRepoName . maybeRepoRemote . fst))
1252-
. sortBy (compare `on` (fmap remoteRepoName . maybeRepoRemote . fst))
1249+
. NE.groupBy ((==) `on` (repoName . fst))
1250+
. sortBy (compare `on` (repoName . fst))
12531251
$ repoTarballPkgsWithMetadata
12541252
]
12551253

0 commit comments

Comments
 (0)