Commit 481caa85 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Remove postProcessPackageData from Util.

parent 21e48fc5
......@@ -43,6 +43,18 @@ configureArgs stage settings =
<> when CrossCompiling (argConf "--host" TargetPlatformFull)
<> argConf "--with-cc" Gcc
-- Prepare a given 'packaga-data.mk' file for parsing by readConfigFile:
-- 1) Drop lines containing '$'
-- 2) Replace '/' and '\' with '_' before '='
postProcessPackageData :: FilePath -> Action ()
postProcessPackageData file = do
pkgData <- (filter ('$' `notElem`) . lines) <$> liftIO (readFile file)
length pkgData `seq` writeFileLines file $ map processLine pkgData
where
processLine line = replaceSeparators '_' prefix ++ suffix
where
(prefix, suffix) = break (== '=') line
buildPackageData :: Package -> TodoItem -> Rules ()
buildPackageData (Package name path _) (stage, dist, settings) =
let pathDist = path </> dist
......
module Util (
module Data.Char,
replaceIf, replaceEq, replaceSeparators,
postProcessPackageData
replaceIf, replaceEq, replaceSeparators
) where
import Base
......@@ -16,14 +15,3 @@ replaceEq from = replaceIf (== from)
replaceSeparators :: Char -> String -> String
replaceSeparators = replaceIf isPathSeparator
-- Prepare a given 'packaga-data.mk' file for parsing by readConfigFile:
-- 1) Drop lines containing '$'
-- 2) Replace '/' and '\' with '_' before '='
postProcessPackageData :: FilePath -> Action ()
postProcessPackageData file = do
pkgData <- (filter ('$' `notElem`) . lines) <$> liftIO (readFile file)
length pkgData `seq` writeFileLines file $ map processLine pkgData
where
processLine line = replaceSeparators '_' prefix ++ suffix
where
(prefix, suffix) = break (== '=') line
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