X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FPackages.lhs;h=d5cfbd10986ef08622eb346ecd4810a6c3f2ae68;hp=0b7798333e787986f044d35a3af1d321e13da676;hb=7eb5e29b4a7b6fef55512bc7bf3308e712ca3eba;hpb=b70f35afc1c606dc85e6feb7da74be72411f58c1 diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 0b77983..d5cfbd1 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -66,6 +66,7 @@ import FastString import ErrUtils ( debugTraceMsg, putMsg, Message ) import System.Directory +import System.FilePath import Data.Maybe import Control.Monad import Data.List @@ -210,14 +211,14 @@ getSystemPackageConfigs dflags = do -- to maintain the package database on systems with a package -- management system, or systems that don't want to run ghc-pkg -- to register or unregister packages. Undocumented feature for now. - let system_pkgconf_dir = system_pkgconf ++ ".d" + let system_pkgconf_dir = system_pkgconf <.> "d" system_pkgconf_dir_exists <- doesDirectoryExist system_pkgconf_dir system_pkgconfs <- if system_pkgconf_dir_exists then do files <- getDirectoryContents system_pkgconf_dir - return [ system_pkgconf_dir ++ '/' : file + return [ system_pkgconf_dir file | file <- files - , isSuffixOf ".conf" file] + , takeExtension file == ".conf" ] else return [] -- Read user's package conf (eg. ~/.ghc/i386-linux-6.3/package.conf) @@ -228,8 +229,8 @@ getSystemPackageConfigs dflags = do appdir <- getAppUserDataDirectory "ghc" let pkgconf = appdir - `joinFileName` (TARGET_ARCH ++ '-':TARGET_OS ++ '-':cProjectVersion) - `joinFileName` "package.conf" + (TARGET_ARCH ++ '-':TARGET_OS ++ '-':cProjectVersion) + "package.conf" flg <- doesFileExist pkgconf if (flg && dopt Opt_ReadUserPackageConf dflags) then return [pkgconf]