Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7ded699b6403e1f8e3343667b7039ac23be4636d

>---------------------------------------------------------------

commit 7ded699b6403e1f8e3343667b7039ac23be4636d
Author: bjorn <[email protected]>
Date:   Mon Oct 8 20:08:32 2007 +0000

    Handle -fflag options.

>---------------------------------------------------------------

 cabal-install/Hackage/Dependency.hs |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cabal-install/Hackage/Dependency.hs 
b/cabal-install/Hackage/Dependency.hs
index 0d5a0a6..1cfdc28 100644
--- a/cabal-install/Hackage/Dependency.hs
+++ b/cabal-install/Hackage/Dependency.hs
@@ -110,15 +110,15 @@ getDependencies comp _installed _available pkg opts
 
 -- | Extracts configurations flags from a list of options.
 configurationsFlags :: [String] -> [(String, Bool)]
-configurationsFlags opts = 
-    case filter ("--flags=" `isPrefixOf`) opts of
-      [] -> []
-      xs -> flagList $ removeQuotes $ drop 8 $ last xs
-  where removeQuotes ('"':s) = take (length s - 1) s
-        removeQuotes s = s
-        flagList = map tagWithValue . words
-            where tagWithValue ('-':name) = (map toLower name, False)
-                  tagWithValue name       = (map toLower name, True)
+configurationsFlags = concatMap flag
+    where
+      flag o | "--flags=" `isPrefixOf` o = map tagWithValue $ words $ 
removeQuotes $ drop 8 o
+             | "-f" `isPrefixOf` o = [tagWithValue $ drop 2 o]
+             | otherwise = []
+      removeQuotes (c:s) | c == '"' || c == '\'' = take (length s - 1) s
+      removeQuotes s = s
+      tagWithValue ('-':name) = (map toLower name, False)
+      tagWithValue name       = (map toLower name, True)
 
 packagesToInstall :: [ResolvedPackage] 
                   -> Either [Dependency] [(PkgInfo, [String])]



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to