[commit: ghc] wip/nfs-locking: Fix postProcessPackageData. (bf9edba)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:17:13 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/bf9edba4364ffc59eb13b6501c11560b71b6e620/ghc
>---------------------------------------------------------------
commit bf9edba4364ffc59eb13b6501c11560b71b6e620
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Tue Dec 30 17:32:37 2014 +0000
Fix postProcessPackageData.
>---------------------------------------------------------------
bf9edba4364ffc59eb13b6501c11560b71b6e620
src/Util.hs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/Util.hs b/src/Util.hs
index b8a38f4..846f547 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -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
More information about the ghc-commits
mailing list