Commit baec65d3 authored by simonmar's avatar simonmar
Browse files

[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.
parent 6b432de5
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $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 -- Package management tool
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -57,17 +57,16 @@ unDosifyPath xs = subst '\\' '/' xs ...@@ -57,17 +57,16 @@ unDosifyPath xs = subst '\\' '/' xs
#endif #endif
runit clis = do runit clis = do
#ifndef mingw32_TARGET_OS
conf_file <- conf_file <-
case [ f | Config f <- clis ] of case [ f | Config f <- clis ] of
[] -> die "missing -f option, location of package.conf unknown" fs@(_:_) -> return (last fs)
[f] -> return f #ifndef mingw32_TARGET_OS
_ -> die (usageInfo usageHeader flags) [] -> die "missing -f option, location of package.conf unknown"
#else #else
h <- getModuleHandle Nothing [] -> do h <- getModuleHandle Nothing
n <- getModuleFileName h n <- getModuleFileName h
let conf_file = reverse (tail (dropWhile (not . isSlash) (reverse (unDosifyPath n)))) return (reverse (tail (dropWhile (not . isSlash)
++ "/package.conf" (reverse (unDosifyPath n)))) ++ "/package.conf")
#endif #endif
let toField "import_dirs" = return import_dirs let toField "import_dirs" = return import_dirs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment