Unverified Commit 40cd3f16 authored by Matt Renaud's avatar Matt Renaud Committed by GitHub
Browse files

Don't write Setup.hs file during cabal init (Merge PR #6603)

When build-type: Simple the contents of Setup.hs MUST BE standard. It is only
in advanced cases where a custom setup file is needed. This is permitted on Hackage which contains packages without Setup.hs inside them.
parents 7fda66f6 4a76b209
...@@ -130,7 +130,6 @@ initCabal verbosity packageDBs repoCtxt comp progdb initFlags = do ...@@ -130,7 +130,6 @@ initCabal verbosity packageDBs repoCtxt comp progdb initFlags = do
case license initFlags' of case license initFlags' of
Flag PublicDomain -> return () Flag PublicDomain -> return ()
_ -> writeLicense initFlags' _ -> writeLicense initFlags'
writeSetupFile initFlags'
writeChangeLog initFlags' writeChangeLog initFlags'
createDirectories (sourceDirs initFlags') createDirectories (sourceDirs initFlags')
createLibHs initFlags' createLibHs initFlags'
...@@ -861,16 +860,6 @@ getYear = do ...@@ -861,16 +860,6 @@ getYear = do
(y, _, _) = toGregorian $ localDay l (y, _, _) = toGregorian $ localDay l
return y return y
writeSetupFile :: InitFlags -> IO ()
writeSetupFile flags = do
message flags "Generating Setup.hs..."
writeFileSafe flags "Setup.hs" setupFile
where
setupFile = unlines
[ "import Distribution.Simple"
, "main = defaultMain"
]
writeChangeLog :: InitFlags -> IO () writeChangeLog :: InitFlags -> IO ()
writeChangeLog flags = when ((defaultChangeLog `elem`) $ fromMaybe [] (extraSrc flags)) $ do writeChangeLog flags = when ((defaultChangeLog `elem`) $ fromMaybe [] (extraSrc flags)) $ do
message flags ("Generating "++ defaultChangeLog ++"...") message flags ("Generating "++ defaultChangeLog ++"...")
......
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