summaryrefslogtreecommitdiff
path: root/Build/EvilLinker.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-09 15:17:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-09 15:17:55 -0400
commit5d317483e788ee3bfd644b46d5ef16870129d168 (patch)
tree82f5081dff552bbd644f0d3560832bda6a5e002b /Build/EvilLinker.hs
parent39b9df62c7a60efc95c0acd17cb0260dfdc6e9b5 (diff)
detect parse failure where command is somehow empty (wtf?)
Diffstat (limited to 'Build/EvilLinker.hs')
-rw-r--r--Build/EvilLinker.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs
index d26f9c2b7..8166d0e83 100644
--- a/Build/EvilLinker.hs
+++ b/Build/EvilLinker.hs
@@ -124,13 +124,15 @@ runParser' p s paramfile = either failedparse id (parse p "" s)
failedparse e = error $
(show e) ++
"\n<<<\n" ++ s ++ "\n>>>" ++
- "\nparam file contained: <<<\n" ++ paramfile ++ "\n>>>"
+ "\nparam file contained: >>>\n" ++ paramfile ++ "\n<<<"
atFile :: FilePath -> String
atFile f = '@':f
runAtFile :: Parser CmdParams -> String -> FilePath -> [String] -> IO (String, Bool)
runAtFile p s f extraparams = do
+ when (null $ opts c) $
+ error $ "failed to find any options for " ++ f ++ " in >>>" ++ s ++ "<<<"
writeFile f (opts c)
out <- getOutput (cmd c) (atFile f:extraparams) (env c)
removeFile f