From: simonmar Date: Mon, 13 Aug 2001 16:32:22 +0000 (+0000) Subject: [project @ 2001-08-13 16:32:22 by simonmar] X-Git-Tag: Approximately_9120_patches~1271 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=baec65d34d4a92c27c69dfb5fd170b1a0b3915e1;hp=6b432de578655afe492d42bb96234971597d7375;p=ghc-hetmet.git [project @ 2001-08-13 16:32:22 by simonmar] Allow multiple -f/--config-file options, taking the last one. This allows ghc-pkg to be used to modify a user-specified package.conf file. --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 7e76758..2a5f9a7 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.11 2001/07/11 11:01:59 rrt Exp $ +-- $Id: Main.hs,v 1.12 2001/08/13 16:32:22 simonmar Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -57,17 +57,16 @@ unDosifyPath xs = subst '\\' '/' xs #endif runit clis = do -#ifndef mingw32_TARGET_OS conf_file <- case [ f | Config f <- clis ] of - [] -> die "missing -f option, location of package.conf unknown" - [f] -> return f - _ -> die (usageInfo usageHeader flags) + fs@(_:_) -> return (last fs) +#ifndef mingw32_TARGET_OS + [] -> die "missing -f option, location of package.conf unknown" #else - h <- getModuleHandle Nothing - n <- getModuleFileName h - let conf_file = reverse (tail (dropWhile (not . isSlash) (reverse (unDosifyPath n)))) - ++ "/package.conf" + [] -> do h <- getModuleHandle Nothing + n <- getModuleFileName h + return (reverse (tail (dropWhile (not . isSlash) + (reverse (unDosifyPath n)))) ++ "/package.conf") #endif let toField "import_dirs" = return import_dirs