Skip to content

Commit

Permalink
Remove parameter ignored by defaultInstallDirs
Browse files Browse the repository at this point in the history
The function defaultInstallDirs completely ignores its last parameter.
This change removes it.
  • Loading branch information
andreabedini committed Aug 31, 2023
1 parent 747af13 commit fabaa0d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ configure (pkg_descr0, pbi) cfg = do
use_external_internal_deps
(compilerFlavor comp)
(fromFlag (configUserInstall cfg))
(hasLibs pkg_descr)
let installDirs :: InstallDirTemplates
installDirs =
combineInstallDirs
Expand Down
9 changes: 4 additions & 5 deletions Cabal/src/Distribution/Simple/InstallDirs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,24 +175,23 @@ type InstallDirTemplates = InstallDirs PathTemplate
-- ---------------------------------------------------------------------------
-- Default installation directories

defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates
defaultInstallDirs :: CompilerFlavor -> Bool -> IO InstallDirTemplates
defaultInstallDirs = defaultInstallDirs' False

defaultInstallDirs'
:: Bool {- use external internal deps -}
-> CompilerFlavor
-> Bool
-> Bool
-> IO InstallDirTemplates
defaultInstallDirs' True comp userInstall hasLibs = do
dflt <- defaultInstallDirs' False comp userInstall hasLibs
defaultInstallDirs' True comp userInstall = do
dflt <- defaultInstallDirs' False comp userInstall
-- Be a bit more hermetic about per-component installs
return
dflt
{ datasubdir = toPathTemplate $ "$abi" </> "$libname"
, docdir = toPathTemplate $ "$datadir" </> "doc" </> "$abi" </> "$libname"
}
defaultInstallDirs' False comp userInstall _hasLibs = do
defaultInstallDirs' False comp userInstall = do
installPrefix <-
if userInstall
then do
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,8 @@ writeConfigFile file comments vals = do
-- overriding.
commentSavedConfig :: IO SavedConfig
commentSavedConfig = do
userInstallDirs <- defaultInstallDirs defaultCompiler True True
globalInstallDirs <- defaultInstallDirs defaultCompiler False True
userInstallDirs <- defaultInstallDirs defaultCompiler True
globalInstallDirs <- defaultInstallDirs defaultCompiler False
let conf0 =
mempty
{ savedGlobalFlags =
Expand Down
4 changes: 1 addition & 3 deletions cabal-install/src/Distribution/Client/Install.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ regenerateHaddockIndex
InstallDirs.defaultInstallDirs
(compilerFlavor comp)
(fromFlag (configUserInstall configFlags))
True
let indexFileTemplate = fromFlag (installHaddockIndex installFlags)
indexFile = substHaddockIndexFileName defaultDirs indexFileTemplate

Expand Down Expand Up @@ -1993,7 +1992,7 @@ installUnpackedPackage

addDefaultInstallDirs :: ConfigFlags -> IO ConfigFlags
addDefaultInstallDirs configFlags' = do
defInstallDirs <- InstallDirs.defaultInstallDirs flavor userInstall False
defInstallDirs <- InstallDirs.defaultInstallDirs flavor userInstall
return $
configFlags'
{ configInstallDirs =
Expand Down Expand Up @@ -2120,7 +2119,6 @@ withWin32SelfUpgrade verbosity uid configFlags cinfo platform pkg action = do
InstallDirs.defaultInstallDirs
compFlavor
(fromFlag (configUserInstall configFlags))
(PackageDescription.hasLibs pkg)

Win32SelfUpgrade.possibleSelfUpgrade
verbosity
Expand Down
1 change: 0 additions & 1 deletion cabal-install/src/Distribution/Client/InstallSymlink.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ symlinkBinaries
InstallDirs.defaultInstallDirs
compilerFlavor
(fromFlag (configUserInstall configFlags))
(PackageDescription.hasLibs pkg)
let templateDirs =
InstallDirs.combineInstallDirs
fromFlagOrDefault
Expand Down
1 change: 0 additions & 1 deletion cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4033,7 +4033,6 @@ userInstallDirTemplates compiler = do
InstallDirs.defaultInstallDirs
(compilerFlavor compiler)
True -- user install
False -- unused

storePackageInstallDirs
:: StoreDirLayout
Expand Down

0 comments on commit fabaa0d

Please sign in to comment.