on master help sign in
Work around haskell/hackage-server#141
commite435e756881e65da13331427eaa8d129d01c8f57 authorMichael Snoyman <michael@snoyman.com> dateTue 4 Nov 2014, 20:32 (12 years ago) parent7828e75
1 file changed+6−1
Stackage/BuildPlan.hs+6−1
Stackage/BuildPlan.hs+6−1
@@ -14,6 +14,7 @@ import Stackage.Types
1414import qualified System.IO.UTF8
1515import Data.Char (isSpace)
1616import Stackage.Util
17+import Data.List (intercalate)
1718
1819readBuildPlan :: FilePath -> IO BuildPlan
1920readBuildPlan fp = do
@@ -162,8 +163,12 @@ writeBuildPlanCsv :: FilePath -> BuildPlan -> IO ()
162163writeBuildPlanCsv fp bp =
163164 -- Obviously a proper CSV library should be used... but we're minimizing
164165 -- deps
165− System.IO.UTF8.writeFile fp $ unlines $ map toRow $ Map.toList fullMap
166+ System.IO.UTF8.writeFile fp $ unlines' $ map toRow $ Map.toList fullMap
166167 where
168+ -- Hackage server is buggy, and won't accept trailing newlines. See:
169+ -- https://github.com/haskell/hackage-server/issues/141#issuecomment-34615935
170+ unlines' = intercalate "\n"
171+
167172 fullMap = Map.unions
168173 [ fmap spiVersion $ bpPackages bp
169174 , Map.mapMaybe id $ bpCore bp