diff options
author | Edsko de Vries <edsko@well-typed.com> | 2015-01-14 17:58:13 -0600 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2015-01-19 06:50:12 -0600 |
commit | d33e2ffbe33a99252708a9761995109ddac04a7f (patch) | |
tree | 01afea7ccc773c55460f81672aff4e2b97ad573b /compiler | |
parent | d6ddfcc0d49415513a2394b02c3cff641c9dc865 (diff) | |
download | haskell-d33e2ffbe33a99252708a9761995109ddac04a7f.tar.gz |
Don't hardcode the name "ghc" in versionedAppDir
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D618
(cherry picked from commit 6392df07e89304a4daeb1af379c051b03a39cda7)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/CmdLineParser.hs | 2 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 8 | ||||
-rw-r--r-- | compiler/main/Packages.hs | 5 |
3 files changed, 7 insertions, 8 deletions
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs index 951db0e9d0..dc2fd1cb21 100644 --- a/compiler/main/CmdLineParser.hs +++ b/compiler/main/CmdLineParser.hs @@ -18,7 +18,7 @@ module CmdLineParser Flag(..), defFlag, defGhcFlag, defGhciFlag, defHiddenFlag, errorsToGhcException, - EwM(..), runEwM, addErr, addWarn, getArg, getCurLoc, liftEwM, deprecate + EwM, runEwM, addErr, addWarn, getArg, getCurLoc, liftEwM, deprecate ) where #include "HsVersions.h" diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index a1b1400571..c373fdfe3c 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1021,9 +1021,9 @@ opt_lc dflags = sOpt_lc (settings dflags) -- | The directory for this version of ghc in the user's app directory -- (typically something like @~/.ghc/x86_64-linux-7.6.3@) -- -versionedAppDir :: IO FilePath -versionedAppDir = do - appdir <- getAppUserDataDirectory "ghc" +versionedAppDir :: DynFlags -> IO FilePath +versionedAppDir dflags = do + appdir <- getAppUserDataDirectory (programName dflags) return $ appdir </> (TARGET_ARCH ++ '-':TARGET_OS ++ '-':cProjectVersion) -- | The target code type of the compilation (if any). @@ -3768,7 +3768,7 @@ interpretPackageEnv dflags = do namedEnvPath :: String -> MaybeT IO FilePath namedEnvPath name = do - appdir <- liftMaybeT $ versionedAppDir + appdir <- liftMaybeT $ versionedAppDir dflags return $ appdir </> "environments" </> name loadEnvName :: String -> MaybeT IO String diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index e081a31f25..dec7b5b88b 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -354,10 +354,9 @@ getPackageConfRefs dflags = do resolvePackageConfig :: DynFlags -> PkgConfRef -> IO (Maybe FilePath) resolvePackageConfig dflags GlobalPkgConf = return $ Just (systemPackageConfig dflags) -resolvePackageConfig _ UserPkgConf = handleIO (\_ -> return Nothing) $ do - dir <- versionedAppDir +resolvePackageConfig dflags UserPkgConf = handleIO (\_ -> return Nothing) $ do + dir <- versionedAppDir dflags let pkgconf = dir </> "package.conf.d" - exist <- doesDirectoryExist pkgconf return $ if exist then Just pkgconf else Nothing resolvePackageConfig _ (PkgConfFile name) = return $ Just name |