Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
7ded699b
Commit
7ded699b
authored
Oct 08, 2007
by
bjorn@bringert.net
Browse files
Handle -fflag options.
parent
f02064d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Hackage/Dependency.hs
View file @
7ded699b
...
...
@@ -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
.
word
s
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
])]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment