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

Put quotes around program names in some error messages

One user reported being rather confused by the message:

  cabal: The program happy version >=1.18.5 is required but it could
  not be found.

I guess they must have been wondering what a happy version was. They
said that this is much clearer:

  cabal: The program 'happy' version >=1.18.5 is required but it could
  not be found.

So that's what we now do.
parent 42699eaa
......@@ -914,9 +914,11 @@ configurePkgconfigPackages verbosity pkg_descr conf
Just v | not (withinRange v range) -> die (badVersion v)
| otherwise -> info verbosity (depSatisfied v)
where
notFound = "The pkg-config package " ++ pkg ++ versionRequirement
notFound = "The pkg-config package '" ++ pkg ++ "'"
++ versionRequirement
++ " is required but it could not be found."
badVersion v = "The pkg-config package " ++ pkg ++ versionRequirement
badVersion v = "The pkg-config package '" ++ pkg ++ "'"
++ versionRequirement
++ " is required but the version installed on the"
++ " system is version " ++ display v
depSatisfied v = "Dependency " ++ display dep
......@@ -1187,6 +1189,7 @@ checkForeignDeps pkg lbi verbosity = do
_ <- rawSystemProgramStdoutConf verbosity
gccProgram (withPrograms lbi) (cName:"-o":oNname:args)
return True
--TODO: need a better error in the case of not finding gcc!
`catchIO` (\_ -> return False)
`catchExit` (\_ -> return False)
......
......@@ -168,8 +168,8 @@ runDbProgram verbosity prog programDb args =
Nothing -> die notFound
Just configuredProg -> runProgram verbosity configuredProg args
where
notFound = "The program " ++ programName prog
++ " is required but it could not be found"
notFound = "The program '" ++ programName prog
++ "' is required but it could not be found"
-- | Looks up the given program in the program database and runs it.
--
......@@ -183,8 +183,8 @@ getDbProgramOutput verbosity prog programDb args =
Nothing -> die notFound
Just configuredProg -> getProgramOutput verbosity configuredProg args
where
notFound = "The program " ++ programName prog
++ " is required but it could not be found"
notFound = "The program '" ++ programName prog
++ "' is required but it could not be found"
---------------------
......
......@@ -383,8 +383,8 @@ requireProgram verbosity prog conf = do
Nothing -> die notFound
Just configuredProg -> return (configuredProg, conf')
where notFound = "The program " ++ programName prog
++ " is required but it could not be found."
where notFound = "The program '" ++ programName prog
++ "' is required but it could not be found."
-- | Check that a program is configured and available to be run.
......@@ -416,15 +416,15 @@ requireProgramVersion verbosity prog range conf = do
| otherwise -> die (badVersion version location)
Nothing -> die (noVersion location)
where notFound = "The program "
++ programName prog ++ versionRequirement
where notFound = "The program '"
++ programName prog ++ "'" ++ versionRequirement
++ " is required but it could not be found."
badVersion v l = "The program "
++ programName prog ++ versionRequirement
badVersion v l = "The program '"
++ programName prog ++ "'" ++ versionRequirement
++ " is required but the version found at "
++ locationPath l ++ " is version " ++ display v
noVersion l = "The program "
++ programName prog ++ versionRequirement
noVersion l = "The program '"
++ programName prog ++ "'" ++ versionRequirement
++ " is required but the version of "
++ locationPath l ++ " could not be determined."
versionRequirement
......
Supports Markdown
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