summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6b432de)
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.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- $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
-----------------------------------------------------------------------------
-#ifndef mingw32_TARGET_OS
conf_file <-
case [ f | Config f <- clis ] of
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"
- 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
#endif
let toField "import_dirs" = return import_dirs