Skip to content

Commit

Permalink
Fix RemoteRepo test
Browse files Browse the repository at this point in the history
  • Loading branch information
jgotoh committed Jul 26, 2024
1 parent 6634b23 commit 16733e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectConfig/Parsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ parseSection programDb (MkSection (Name pos name) args secFields)
remoteRepo <- lift $ parseFieldGrammar cabalSpec fields (remoteRepoGrammar repoName)
remoteOrLocalRepo <- lift $ postProcessRemoteRepo pos remoteRepo
case remoteOrLocalRepo of
Left local -> stateConfig . L.projectConfigShared %= (\pcs -> pcs{projectConfigLocalNoIndexRepos = (toNubList [local] <> projectConfigLocalNoIndexRepos pcs)})
Right remote -> stateConfig . L.projectConfigShared %= (\pcs -> pcs{projectConfigRemoteRepos = (toNubList [remote] <> projectConfigRemoteRepos pcs)})
Left local -> stateConfig . L.projectConfigShared %= (\pcs -> pcs{projectConfigLocalNoIndexRepos = (projectConfigLocalNoIndexRepos pcs <> toNubList [local])})
Right remote -> stateConfig . L.projectConfigShared %= (\pcs -> pcs{projectConfigRemoteRepos = (projectConfigRemoteRepos pcs <> toNubList [remote])})
Nothing -> lift $ parseFailure pos "a 'repository' section requires the repository name as an argument"
| name == "package" = do
verifyNullSubsections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,16 @@ testRemoteRepos = do
, remoteRepoURI = fromJust $ parseURI "http://packages.example.org/"
, remoteRepoSecure = pure True
, remoteRepoRootKeys = ["21", "42"]
, remoteRepoKeyThreshold = 123
, remoteRepoKeyThreshold = 2
, remoteRepoShouldTryHttps = False
}
morePackagesRepository =
RemoteRepo
{ remoteRepoName = RepoName $ "more-packages.example.org"
, remoteRepoURI = fromJust $ parseURI "https://more-packages.example.org/"
, remoteRepoSecure = pure False
, remoteRepoSecure = pure True
, remoteRepoRootKeys = ["foo", "bar"]
, remoteRepoKeyThreshold = 42
, remoteRepoKeyThreshold = 1
, remoteRepoShouldTryHttps = False
}
secureLocalRepository =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ repository packages.example.org
url: http://packages.example.org/
secure: True
root-keys: 21, 42
key-threshold: 123
key-threshold: 2

repository more-packages.example.org
url: https://more-packages.example.org/
secure: False
secure: True
root-keys: foo
, bar
key-threshold: 42
key-threshold: 1

repository my-secure-local-repository
url: file:/path/to/secure/repo
Expand Down

0 comments on commit 16733e1

Please sign in to comment.