Commit f1e706bc authored by Vít Šefl's avatar Vít Šefl

Use appDir/getGhcAppDir consistently.

parent 829a00e7
......@@ -2060,7 +2060,7 @@ pkgRoot verbosity lbi = pkgRoot'
let ghcProg = fromMaybe (error "GHC.pkgRoot: no ghc program") $ lookupProgram ghcProgram (withPrograms lbi)
in fmap takeDirectory (getGlobalPackageDB verbosity ghcProg)
pkgRoot' UserPackageDB = do
appDir <- getAppUserDataDirectory "ghc"
appDir <- getGhcAppDir
let ver = compilerVersion (compiler lbi)
subdir = System.Info.arch ++ '-':System.Info.os
++ '-':prettyShow ver
......
......@@ -850,13 +850,13 @@ entriesForLibraryComponents = Map.foldrWithKey' (\k v -> mappend (go k v)) []
-- | Gets the file file path to the request environment file.
getEnvFile :: ClientInstallFlags -> Platform -> Version -> IO FilePath
getEnvFile clientInstallFlags platform compilerVersion = do
appData <- getGhcAppDir
appDir <- getGhcAppDir
case flagToMaybe (cinstEnvironmentPath clientInstallFlags) of
Just spec
-- Is spec a bare word without any "pathy" content, then it refers to
-- a named global environment.
| takeBaseName spec == spec ->
return (getGlobalEnv appData platform compilerVersion spec)
return (getGlobalEnv appDir platform compilerVersion spec)
| otherwise -> do
spec' <- makeAbsolute spec
isDir <- doesDirectoryExist spec'
......@@ -867,7 +867,7 @@ getEnvFile clientInstallFlags platform compilerVersion = do
-- Otherwise, treat it like a literal file path.
else return spec'
Nothing ->
return (getGlobalEnv appData platform compilerVersion "default")
return (getGlobalEnv appDir platform compilerVersion "default")
-- | Returns the list of @GhcEnvFilePackageIj@ values already existing in the
-- environment being operated on.
......@@ -891,8 +891,8 @@ getExistingEnvEntries verbosity compilerFlavor supportsPkgEnvFiles envFile = do
--
-- TODO(m-renaud): Create PkgEnvName newtype wrapper.
getGlobalEnv :: FilePath -> Platform -> Version -> String -> FilePath
getGlobalEnv appData platform compilerVersion name =
appData </> ghcPlatformAndVersionString platform compilerVersion
getGlobalEnv appDir platform compilerVersion name =
appDir </> ghcPlatformAndVersionString platform compilerVersion
</> "environments" </> name
-- | Constructs the path to a local GHC environment file.
......
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