diff options
authorBenjamin Gordon <>2020-01-29 12:38:13 -0700
committerSergei Trofimovich <>2020-01-29 22:04:46 +0000
commitf58d31d661f7bda2fe7b591419f0d9f138a2dae6 (patch)
parentx11-libs/libxcb: Add support for Python 3.8. Drop support for Python 2.7. (diff)
ghc-package.eclass: Handle missing ghc in lookups
ghc-getghc() and ghc-getghcpkg() both assume that they can find an installed binary. If ghc isn't installed (e.g., because it's being being rebuilt or has been unmerged), there is no such binary. This causes the intended arguments to be run as a command, which produces "command not found" QA Notices. If ghc can't be found, return "false" instead. The false command will harmlessly absorb the other command-line arguments. This doesn't produce any difference in the final result because the invalid commands were failing anyway. Closes: Signed-off-by: Benjamin Gordon <> Closes: Signed-off-by: Sergei Trofimovich <>
1 files changed, 8 insertions, 2 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass
index 27fafff5a21..dbe7dc2a5ac 100644
--- a/eclass/ghc-package.eclass
+++ b/eclass/ghc-package.eclass
@@ -22,14 +22,20 @@ esac
# returns the name of the ghc executable
ghc-getghc() {
- type -P ${HC:-ghc}
+ if ! type -P ${HC:-ghc}; then
+ ewarn "ghc not found"
+ type -P false
+ fi
# @FUNCTION: ghc-getghcpkg
# Internal function determines returns the name of the ghc-pkg executable
ghc-getghcpkg() {
- type -P ${HC_PKG:-ghc-pkg}
+ if ! type -P ${HC_PKG:-ghc-pkg}; then
+ ewarn "ghc-pkg not found"
+ type -P false
+ fi
# @FUNCTION: ghc-getghcpkgbin