mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-24 21:21:58 +01:00
Work around haskell/hackage-server#141
This commit is contained in:
parent
7828e75d34
commit
e435e75688
@ -14,6 +14,7 @@ import Stackage.Types
|
|||||||
import qualified System.IO.UTF8
|
import qualified System.IO.UTF8
|
||||||
import Data.Char (isSpace)
|
import Data.Char (isSpace)
|
||||||
import Stackage.Util
|
import Stackage.Util
|
||||||
|
import Data.List (intercalate)
|
||||||
|
|
||||||
readBuildPlan :: FilePath -> IO BuildPlan
|
readBuildPlan :: FilePath -> IO BuildPlan
|
||||||
readBuildPlan fp = do
|
readBuildPlan fp = do
|
||||||
@ -162,8 +163,12 @@ writeBuildPlanCsv :: FilePath -> BuildPlan -> IO ()
|
|||||||
writeBuildPlanCsv fp bp =
|
writeBuildPlanCsv fp bp =
|
||||||
-- Obviously a proper CSV library should be used... but we're minimizing
|
-- Obviously a proper CSV library should be used... but we're minimizing
|
||||||
-- deps
|
-- deps
|
||||||
System.IO.UTF8.writeFile fp $ unlines $ map toRow $ Map.toList fullMap
|
System.IO.UTF8.writeFile fp $ unlines' $ map toRow $ Map.toList fullMap
|
||||||
where
|
where
|
||||||
|
-- Hackage server is buggy, and won't accept trailing newlines. See:
|
||||||
|
-- https://github.com/haskell/hackage-server/issues/141#issuecomment-34615935
|
||||||
|
unlines' = intercalate "\n"
|
||||||
|
|
||||||
fullMap = Map.unions
|
fullMap = Map.unions
|
||||||
[ fmap spiVersion $ bpPackages bp
|
[ fmap spiVersion $ bpPackages bp
|
||||||
, Map.mapMaybe id $ bpCore bp
|
, Map.mapMaybe id $ bpCore bp
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user