From e435e756881e65da13331427eaa8d129d01c8f57 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 4 Nov 2014 20:32:05 +0200 Subject: [PATCH] Work around haskell/hackage-server#141 --- Stackage/BuildPlan.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Stackage/BuildPlan.hs b/Stackage/BuildPlan.hs index f888356d..c32c2865 100644 --- a/Stackage/BuildPlan.hs +++ b/Stackage/BuildPlan.hs @@ -14,6 +14,7 @@ import Stackage.Types import qualified System.IO.UTF8 import Data.Char (isSpace) import Stackage.Util +import Data.List (intercalate) readBuildPlan :: FilePath -> IO BuildPlan readBuildPlan fp = do @@ -162,8 +163,12 @@ writeBuildPlanCsv :: FilePath -> BuildPlan -> IO () writeBuildPlanCsv fp bp = -- Obviously a proper CSV library should be used... but we're minimizing -- deps - System.IO.UTF8.writeFile fp $ unlines $ map toRow $ Map.toList fullMap + System.IO.UTF8.writeFile fp $ unlines' $ map toRow $ Map.toList fullMap 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 [ fmap spiVersion $ bpPackages bp , Map.mapMaybe id $ bpCore bp