Skip to content

Commit

Permalink
Add haddocks
Browse files Browse the repository at this point in the history
As requested in review
  • Loading branch information
philderbeast committed Dec 12, 2023
1 parent 4606c35 commit f2cf8d9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cabal-install/src/Distribution/Client/CmdInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ data InstallCfg = InstallCfg
, installClientFlags :: ClientInstallFlags
}

-- | A record of install method, install directory and file path functions
-- needed by actions that either check if an install is possible or actually
-- perform an installation. This is for installation of executables only.
data InstallExe = InstallExe
{ installMethod :: InstallMethod
, installDir :: FilePath
Expand Down Expand Up @@ -638,10 +641,11 @@ installAction flags@NixStyleFlags{extraFlags = clientInstallFlags', ..} targetSt
cliConfig = addLocalConfigToTargets baseCliConfig targetStrings
globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig)

-- | Do the install action for each executable in the install configuration.
traverseInstall :: InstallAction -> InstallCfg -> IO ()
traverseInstall action cfg@InstallCfg{verbosity = v, buildCtx, installClientFlags} = do
let overwritePolicy = fromFlagOrDefault NeverOverwrite $ cinstOverwritePolicy installClientFlags
actionOnExe <- action v overwritePolicy <$> installExesPrep cfg
actionOnExe <- action v overwritePolicy <$> prepareExeInstall cfg
traverse_ actionOnExe . Map.toList $ targetsMap buildCtx

-- | Treat all direct targets of install command as local packages: #8637
Expand Down Expand Up @@ -827,8 +831,11 @@ constructProjectBuildContext verbosity baseCtx targetSelectors = do

return (prunedElaboratedPlan, targets)

installExesPrep :: InstallCfg -> IO InstallExe
installExesPrep
-- | From an install configuration, prepare the record needed by actions that
-- will either check if an install of a single executable is possible or
-- actually perform its installation.
prepareExeInstall :: InstallCfg -> IO InstallExe
prepareExeInstall
InstallCfg{verbosity, baseCtx, buildCtx, platform, compiler, installConfigFlags, installClientFlags} = do
installPath <- defaultInstallPath
let storeDirLayout = cabalStoreDirLayout $ cabalDirLayout baseCtx
Expand Down

0 comments on commit f2cf8d9

Please sign in to comment.