summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-04-28 21:57:03 +0100
committerIan Lynagh <ian@well-typed.com>2013-04-28 21:57:03 +0100
commit4d8ad58790180800c4be4ea35da592566ec9bc6d (patch)
tree941697dd41588a6a58c8b54e8b24ab43fe51da7f /utils
parent49e6606b92d3b572da125602352dae96dd1a76cd (diff)
downloadhaskell-4d8ad58790180800c4be4ea35da592566ec9bc6d.tar.gz
Remove some old "backwards compatibility" code
It was marked as "backwards compatibility" in 2006, so I think can be removed now. It allowed using old field names when looking at fields with ghc-pkg.
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs28
1 files changed, 4 insertions, 24 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 816e9eb0d0..3cda838022 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -1156,36 +1156,16 @@ describeField verbosity my_flags pkgarg fields expand_pkgroot = do
fns <- toFields fields
ps <- findPackages flag_db_stack pkgarg
mapM_ (selectFields fns) ps
- where defaultShowFun = if FlagSimpleOutput `elem` my_flags
- then showSimpleInstalledPackageInfoField
- else showInstalledPackageInfoField
+ where showFun = if FlagSimpleOutput `elem` my_flags
+ then showSimpleInstalledPackageInfoField
+ else showInstalledPackageInfoField
toFields [] = return []
- toFields (f:fs) = case toField defaultShowFun f of
+ toFields (f:fs) = case showFun f of
Nothing -> die ("unknown field: " ++ f)
Just fn -> do fns <- toFields fs
return (fn:fns)
selectFields fns pinfo = mapM_ (\fn->putStrLn (fn pinfo)) fns
-toField :: (String -> Maybe (InstalledPackageInfo -> String)) -> String
- -> Maybe (InstalledPackageInfo -> String)
--- backwards compatibility:
-toField _ "import_dirs" = Just $ strList . importDirs
-toField _ "source_dirs" = Just $ strList . importDirs
-toField _ "library_dirs" = Just $ strList . libraryDirs
-toField _ "hs_libraries" = Just $ strList . hsLibraries
-toField _ "extra_libraries" = Just $ strList . extraLibraries
-toField _ "include_dirs" = Just $ strList . includeDirs
-toField _ "c_includes" = Just $ strList . includes
-toField _ "package_deps" = Just $ strList . map display. depends
-toField _ "extra_cc_opts" = Just $ strList . ccOptions
-toField _ "extra_ld_opts" = Just $ strList . ldOptions
-toField _ "framework_dirs" = Just $ strList . frameworkDirs
-toField _ "extra_frameworks" = Just $ strList . frameworks
-toField defaultShowFun s = defaultShowFun s
-
-strList :: [String] -> String
-strList = show
-
-- -----------------------------------------------------------------------------
-- Check: Check consistency of installed packages