Commit bf9edba4 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fix postProcessPackageData.

parent 9007c90c
......@@ -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
Supports Markdown
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