Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
bf9edba4
Commit
bf9edba4
authored
Dec 30, 2014
by
Andrey Mokhov
Browse files
Fix postProcessPackageData.
parent
9007c90c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Util.hs
View file @
bf9edba4
...
...
@@ -19,8 +19,12 @@ replaceEq from = replaceIf (== from)
-- Prepare a given 'packaga-data.mk' file for parsing by readConfigFile:
-- 1) Drop lines containing '$'
-- 2) Replace '/' and '\' with '_'
-- 2) Replace '/' and '\' with '_'
before '='
postProcessPackageData
::
FilePath
->
Action
()
postProcessPackageData
file
=
do
pkgData
<-
(
filter
(
'$'
`
notElem
`)
.
lines
)
<$>
liftIO
(
readFile
file
)
length
pkgData
`
seq
`
writeFileLines
file
$
map
(
replaceIf
isSlash
'_'
)
pkgData
length
pkgData
`
seq
`
writeFileLines
file
$
map
processLine
pkgData
where
processLine
line
=
replaceIf
isSlash
'_'
prefix
++
suffix
where
(
prefix
,
suffix
)
=
break
(
==
'='
)
line
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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