summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-04-04 02:04:39 +0100
committerSam James <sam@gentoo.org>2023-04-10 09:47:01 +0100
commit2ab2bdd668c68d32525c8ca388cf28678d3ccff0 (patch)
tree44ef75b689a45f614e08bc14482f9434ef038d73 /eclass
parentmedia-gfx/hydrus: Remove 518 (diff)
downloadgentoo-2ab2bdd668c68d32525c8ca388cf28678d3ccff0.tar.gz
gentoo-2ab2bdd668c68d32525c8ca388cf28678d3ccff0.tar.bz2
gentoo-2ab2bdd668c68d32525c8ca388cf28678d3ccff0.zip
ruby-ng.eclass: error out earlier if RUBY is unset
This might prevent an ebuild installing no files, but the main aim here is to give a better error message earlier on rather than the classic "Unable to generate gemspec file". The output looks like: ``` * Failed to determine a path for ${RUBY} for USE=ruby_targets_ruby31: * ruby_implementation_command returned an empty RUBY for ruby31 * ERROR: dev-ruby/mercenary-0.4.0-r1::gentoo failed (setup phase): * Could not find RUBY for ruby31. Is dev-lang/ruby:3.1 installed? ``` Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-ng.eclass7
1 files changed, 7 insertions, 0 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index b81038237a6b..d808b7bd98b3 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -419,6 +419,13 @@ _ruby_each_implementation() {
use ruby_targets_${_ruby_implementation} || continue
RUBY=$(ruby_implementation_command ${_ruby_implementation})
+
+ if [[ -z ${RUBY} ]]; then
+ eerror "Failed to determine a path for \${RUBY} for USE=ruby_targets_${_ruby_implementation}:"
+ eerror " ruby_implementation_command returned an empty RUBY for ${_ruby_implementation}"
+ die "Could not find RUBY for ${_ruby_implementation}. Is $(_ruby_implementation_depend ${_ruby_implementation}) installed?"
+ fi
+
invoked=yes
if [[ -n "$1" ]]; then