Skip to content
Snippets Groups Projects
Unverified Commit 9d95ec8d authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Merge pull request #10021 from haskell/mergify/bp/3.12/pr-9771

offline flag disables `source-repository-package` sync (backport #9771)
parents 8deb30ec df33ffd4
No related branches found
No related tags found
No related merge requests found
......@@ -1196,6 +1196,7 @@ fetchAndReadSourcePackages
verbosity
distDirLayout
projectConfigShared
(fromFlag (projectConfigOfflineMode projectConfigBuildOnly))
[repo | ProjectPackageRemoteRepo repo <- pkgLocations]
let pkgsNamed =
......@@ -1312,6 +1313,7 @@ syncAndReadSourcePackagesRemoteRepos
:: Verbosity
-> DistDirLayout
-> ProjectConfigShared
-> Bool
-> [SourceRepoList]
-> Rebuild [PackageSpecifier (SourcePackage UnresolvedPkgLoc)]
syncAndReadSourcePackagesRemoteRepos
......@@ -1320,6 +1322,7 @@ syncAndReadSourcePackagesRemoteRepos
ProjectConfigShared
{ projectConfigProgPathExtra
}
offlineMode
repos = do
repos' <-
either reportSourceRepoProblems return $
......@@ -1374,12 +1377,18 @@ syncAndReadSourcePackagesRemoteRepos
-- For syncing we don't care about different 'SourceRepo' values that
-- are just different subdirs in the same repo.
syncSourceRepos
verbosity
vcs
[ (repo, repoPath)
| (repo, _, repoPath) <- repoGroupWithPaths
]
-- Do not sync source repositories when `--offline` flag applied.
if not offlineMode
then
syncSourceRepos
verbosity
vcs
[ (repo, repoPath)
| (repo, _, repoPath) <- repoGroupWithPaths
]
else do
liftIO . warn verbosity $ "--offline was specified, skipping sync of repositories:"
liftIO . for_ repoGroupWithPaths $ \(repo, _, _) -> warn verbosity $ srpLocation repo
-- Run post-checkout-command if it is specified
for_ repoGroupWithPaths $ \(repo, _, repoPath) ->
......
synopsis: offline flag applied to `source-repository-package`s
packages: Cabal-install
prs: #9771
issues: #9641
description: {
`--offline` flag is already used to block access to Hackage. Now with this PR, this also applies to remote dependency `source-repository-package` in `cabal.project`.
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment