[commit: ghc] ghc-7.8: Avoid NondecreasingIndentation syntax in ghc-pkg (2b854a1)
git at git.haskell.org
git at git.haskell.org
Fri Jul 4 00:05:36 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-7.8
Link : http://ghc.haskell.org/trac/ghc/changeset/2b854a182be15387cf420e982bfb58957dd4e1d7/ghc
>---------------------------------------------------------------
commit 2b854a182be15387cf420e982bfb58957dd4e1d7
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Wed May 14 12:16:13 2014 +0200
Avoid NondecreasingIndentation syntax in ghc-pkg
This also makes ghc-pkg.cabal `default-extensions`-free
NB: Printing this commit via `git show --ignore-all-spaces` shows the
only non-whitespaces changes are in `ghc-pkg.cabal`
Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
(cherry picked from commit 913b3146541e203b2524e756b047b7f90be849b7)
Conflicts:
utils/ghc-pkg/ghc-pkg.cabal
>---------------------------------------------------------------
2b854a182be15387cf420e982bfb58957dd4e1d7
utils/ghc-pkg/Main.hs | 60 ++++++++++++++++++++++-----------------------
utils/ghc-pkg/ghc-pkg.cabal | 2 +-
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 30acbe2..8be752b 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -593,9 +593,9 @@ lookForPackageDBIn dir = do
let path_dir = dir </> "package.conf.d"
exists_dir <- doesDirectoryExist path_dir
if exists_dir then return (Just path_dir) else do
- let path_file = dir </> "package.conf"
- exists_file <- doesFileExist path_file
- if exists_file then return (Just path_file) else return Nothing
+ let path_file = dir </> "package.conf"
+ exists_file <- doesFileExist path_file
+ if exists_file then return (Just path_file) else return Nothing
readParseDatabase :: Verbosity
-> Maybe (FilePath,Bool)
@@ -1035,34 +1035,34 @@ listPackages verbosity my_flags mPackageName mModuleName = do
if simple_output then show_simple stack else do
#if defined(mingw32_HOST_OS) || defined(BOOTSTRAPPING)
- mapM_ show_normal stack
+ mapM_ show_normal stack
#else
- let
- show_colour withF db =
- mconcat $ map (<#> termText "\n") $
- (termText (location db) :
- map (termText " " <#>) (map pp_pkg (packages db)))
- where
- pp_pkg p
- | sourcePackageId p `elem` broken = withF Red doc
- | exposed p = doc
- | otherwise = withF Blue doc
- where doc | verbosity >= Verbose
- = termText (printf "%s (%s)" pkg ipid)
- | otherwise
- = termText pkg
- where
- InstalledPackageId ipid = installedPackageId p
- pkg = display (sourcePackageId p)
-
- is_tty <- hIsTerminalDevice stdout
- if not is_tty
- then mapM_ show_normal stack
- else do tty <- Terminfo.setupTermFromEnv
- case Terminfo.getCapability tty withForegroundColor of
- Nothing -> mapM_ show_normal stack
- Just w -> runTermOutput tty $ mconcat $
- map (show_colour w) stack
+ let
+ show_colour withF db =
+ mconcat $ map (<#> termText "\n") $
+ (termText (location db) :
+ map (termText " " <#>) (map pp_pkg (packages db)))
+ where
+ pp_pkg p
+ | sourcePackageId p `elem` broken = withF Red doc
+ | exposed p = doc
+ | otherwise = withF Blue doc
+ where doc | verbosity >= Verbose
+ = termText (printf "%s (%s)" pkg ipid)
+ | otherwise
+ = termText pkg
+ where
+ InstalledPackageId ipid = installedPackageId p
+ pkg = display (sourcePackageId p)
+
+ is_tty <- hIsTerminalDevice stdout
+ if not is_tty
+ then mapM_ show_normal stack
+ else do tty <- Terminfo.setupTermFromEnv
+ case Terminfo.getCapability tty withForegroundColor of
+ Nothing -> mapM_ show_normal stack
+ Just w -> runTermOutput tty $ mconcat $
+ map (show_colour w) stack
#endif
simplePackageList :: [Flag] -> [InstalledPackageInfo] -> IO ()
diff --git a/utils/ghc-pkg/ghc-pkg.cabal b/utils/ghc-pkg/ghc-pkg.cabal
index 2f42e31..7a44b57 100644
--- a/utils/ghc-pkg/ghc-pkg.cabal
+++ b/utils/ghc-pkg/ghc-pkg.cabal
@@ -16,7 +16,7 @@ cabal-version: >=1.4
Executable ghc-pkg
Main-Is: Main.hs
Other-Modules: Version
- Extensions: CPP, ForeignFunctionInterface, NondecreasingIndentation
+ Extensions: CPP, ForeignFunctionInterface
Build-Depends: base >= 4 && < 5,
directory >= 1 && < 1.3,
More information about the ghc-commits
mailing list