Adopt XDG Base Directory Specification (#7386) · haskell/cabal@9f7dc55

@@ -64,7 +64,7 @@ import Distribution.Simple.BuildPaths

6464

import Distribution.Simple.Program.Find

6565

( ProgramSearchPathEntry(..) )

6666

import Distribution.Client.Config

67-

( defaultInstallPath, getCabalDir, loadConfig, SavedConfig(..) )

67+

( defaultInstallPath, loadConfig, SavedConfig(..) )

6868

import qualified Distribution.Simple.PackageIndex as PI

6969

import Distribution.Solver.Types.PackageIndex

7070

( lookupPackageName, searchByName )

@@ -150,7 +150,7 @@ installCommand = CommandUI

150150

, commandDescription = Just $ \_ -> wrapText $

151151

"Installs one or more packages. This is done by installing them "

152152

++ "in the store and symlinking/copying the executables in the directory "

153-

++ "specified by the --installdir flag (`~/.cabal/bin/` by default). "

153+

++ "specified by the --installdir flag (`~/.local/bin/` by default). "

154154

++ "If you want the installed executables to be available globally, "

155155

++ "make sure that the PATH environment variable contains that directory. "

156156

++ "\n\n"

@@ -254,7 +254,6 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe

254254

withoutProject globalConfig = do

255255

tss <- traverse (parseWithoutProjectTargetSelector verbosity) targetStrings'

256256257-

cabalDir <- getCabalDir

258257

let

259258

projectConfig = globalConfig <> cliConfig

260259

@@ -268,8 +267,9 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe

268267269268

mlogsDir = flagToMaybe projectConfigLogsDir

270269

mstoreDir = flagToMaybe projectConfigStoreDir

271-

cabalDirLayout = mkCabalDirLayout cabalDir mstoreDir mlogsDir

270+

cabalDirLayout <- mkCabalDirLayout mstoreDir mlogsDir

272271272+

let

273273

buildSettings = resolveBuildTimeSettings

274274

verbosity cabalDirLayout

275275

projectConfig

@@ -605,7 +605,7 @@ installExes verbosity baseCtx buildCtx platform compiler

605605

installdir <- fromFlagOrDefault

606606

(warn verbosity installdirUnknown >> pure installPath) $

607607

pure <$> cinstInstalldir clientInstallFlags

608-

createDirectoryIfMissingVerbose verbosity False installdir

608+

createDirectoryIfMissingVerbose verbosity True installdir

609609

warnIfNoExes verbosity buildCtx

610610611611

installMethod <- flagElim defaultMethod return $

@@ -912,11 +912,10 @@ getPackageDbStack

912912

-> Flag FilePath

913913

-> IO PackageDBStack

914914

getPackageDbStack compilerId storeDirFlag logsDirFlag = do

915-

cabalDir <- getCabalDir

916915

mstoreDir <- traverse makeAbsolute $ flagToMaybe storeDirFlag

917916

let

918917

mlogsDir = flagToMaybe logsDirFlag

919-

cabalLayout = mkCabalDirLayout cabalDir mstoreDir mlogsDir

918+

cabalLayout <- mkCabalDirLayout mstoreDir mlogsDir

920919

pure $ storePackageDBStack (cabalStoreDirLayout cabalLayout) compilerId

921920922921

-- | This defines what a 'TargetSelector' means for the @bench@ command.