Commit b7067783 authored by Alexis Williams's avatar Alexis Williams Committed by GitHub

Add default for v2-install (#6092)

* Add default for v2-install
* Add changelog entry
parent 4377463a
......@@ -247,6 +247,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags
let
installLibs = fromFlagOrDefault False (cinstInstallLibs clientInstallFlags)
targetFilter = if installLibs then Just LibKind else Just ExeKind
targetStrings' = if null targetStrings then ["."] else targetStrings
withProject = do
let verbosity' = lessVerbose verbosity
......@@ -257,7 +258,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags
pkgDb <- projectConfigWithBuilderRepoContext verbosity' (buildSettings localBaseCtx) (getSourcePackages verbosity)
let
(targetStrings', packageIds) = partitionEithers . flip fmap targetStrings $
(targetStrings'', packageIds) = partitionEithers . flip fmap targetStrings' $
\str -> case simpleParse str of
Just (pkgId :: PackageId)
| pkgVersion pkgId /= nullVersion -> Right pkgId
......@@ -273,7 +274,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags
then return (packageSpecifiers, packageTargets, projectConfig localBaseCtx)
else do
targetSelectors <- either (reportTargetSelectorProblems verbosity) return
=<< readTargetSelectors (localPackages localBaseCtx) Nothing targetStrings'
=<< readTargetSelectors (localPackages localBaseCtx) Nothing targetStrings''
(specs, selectors) <- withInstallPlan verbosity' localBaseCtx $ \elaboratedPlan _ -> do
-- Split into known targets and hackage packages.
......@@ -373,7 +374,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags
parsePkg pkgName
| Just (pkg :: PackageId) <- simpleParse pkgName = return pkg
| otherwise = die' verbosity ("Invalid package ID: " ++ pkgName)
packageIds <- mapM parsePkg targetStrings
packageIds <- mapM parsePkg targetStrings'
cabalDir <- getCabalDir
let
......@@ -399,7 +400,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags
verbosity buildSettings
(getSourcePackages verbosity)
for_ targetStrings $ \case
for_ targetStrings' $ \case
name
| null (lookupPackageName packageIndex (mkPackageName name))
, xs@(_:_) <- searchByName packageIndex name ->
......
-*-change-log-*-
3.0.0.0 (current development version)
* `v2-install` now has a default when called in a project (#5978, #6014, #6092)
* '--write-ghc-environment-files' now defaults to 'never' (#4242)
* Fix `sdist`'s output when sent to stdout. (#5874)
* Allow a list of dependencies to be provided for `repl --build-depends`. (#5845)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment