[commit: ghc] wip/nfs-locking: Remove postProcessPackageData from Util. (481caa8)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:04:05 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/481caa85874e966d8adc82dddde1313187647167/ghc

>---------------------------------------------------------------

commit 481caa85874e966d8adc82dddde1313187647167
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 11 21:29:13 2015 +0000

    Remove postProcessPackageData from Util.


>---------------------------------------------------------------

481caa85874e966d8adc82dddde1313187647167
 src/Package/Data.hs | 12 ++++++++++++
 src/Util.hs         | 14 +-------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/Package/Data.hs b/src/Package/Data.hs
index e2260fd..eaaa072 100644
--- a/src/Package/Data.hs
+++ b/src/Package/Data.hs
@@ -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
diff --git a/src/Util.hs b/src/Util.hs
index d7e98bd..f91ff79 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -1,7 +1,6 @@
 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



More information about the ghc-commits mailing list