Commit c287be77 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Change where we add a trailing newline when showing InstalledPackageInfo

Do it in the pretty-printing rather than just before writing the file.
parent b37acdb4
......@@ -263,7 +263,7 @@ ppField :: String -> Doc -> Doc
ppField name fielddoc = text name <> colon <+> fielddoc
showFields :: [FieldDescr a] -> a -> String
showFields fields = render . ppFields fields
showFields fields = render . ($+$ text "") . ppFields fields
showSingleNamedField :: [FieldDescr a] -> String -> Maybe (a -> String)
showSingleNamedField fields f =
......
......@@ -148,7 +148,7 @@ register pkg@PackageDescription { library = Just lib }
writeRegistrationFile installedPkgInfo = do
notice verbosity ("Creating package registration file: " ++ regFile)
writeFileAtomic regFile (showInstalledPackageInfo installedPkgInfo ++ "\n")
writeFileAtomic regFile (showInstalledPackageInfo installedPkgInfo)
writeRegisterScript installedPkgInfo =
case compilerFlavor (compiler lbi) of
......@@ -237,7 +237,7 @@ registerPackageHugs verbosity installedPkgInfo pkg lbi inplace _packageDb = do
let installDirs = absoluteInstallDirs pkg lbi NoCopyDest
createDirectoryIfMissingVerbose verbosity True (libdir installDirs)
writeFileAtomic (libdir installDirs </> "package.conf")
(showInstalledPackageInfo installedPkgInfo ++ "\n")
(showInstalledPackageInfo installedPkgInfo)
writeHcPkgRegisterScript :: Verbosity
......
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