Commit 7ded699b authored by bjorn@bringert.net's avatar bjorn@bringert.net
Browse files

Handle -fflag options.

parent f02064d4
......@@ -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])]
......
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