Commit 2a743bbd authored by thomie's avatar thomie Committed by Austin Seipp
Browse files

Delete hack when takeDirectory returns ""

Summary:
Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
longer needed.

Other commits:
* Remove trailing whitespace
* Update comments for #2278

Test Plan: harbormaster

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D213

GHC Trac Issues: #2034
parent 01906c73
......@@ -950,9 +950,7 @@ maybeReadFuzzy str = case reads str of
-- Verify that the 'dirname' portion of a FilePath exists.
--
doesDirNameExist :: FilePath -> IO Bool
doesDirNameExist fpath = case takeDirectory fpath of
"" -> return True -- XXX Hack
_ -> doesDirectoryExist (takeDirectory fpath)
doesDirNameExist fpath = doesDirectoryExist (takeDirectory fpath)
-----------------------------------------------------------------------------
-- Backwards compatibility definition of getModificationTime
......
......@@ -345,16 +345,16 @@ checkOptions mode dflags srcs objs = do
-- Compiler output options
-- called to verify that the output files & directories
-- point somewhere valid.
-- Called to verify that the output files point somewhere valid.
--
-- The assumption is that the directory portion of these output
-- options will have to exist by the time 'verifyOutputFiles'
-- is invoked.
--
-- We create the directories for -odir, -hidir, -outputdir etc. ourselves if
-- they don't exist, so don't check for those here (#2278).
verifyOutputFiles :: DynFlags -> IO ()
verifyOutputFiles dflags = do
-- not -odir: we create the directory for -odir if it doesn't exist (#2278).
let ofile = outputFile dflags
when (isJust ofile) $ do
let fn = fromJust ofile
......
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