Skip building documentation rather than generating an error when rdoc is
missing but documentation is requested. rdoc should not be missing
normally, but this is a common problem when updating from one ruby
target straight to another one. There can be a gap when eselect has not
been triggered again yet for rdoc and another core ruby package may
require rdoc. This is commonly bundler since it has a +doc USE flag.

Signed-off-by: Hans de Graaff <gra...@gentoo.org>
---
 eclass/ruby-fakegem.eclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 6f561f4f6a2f..64c285d70559 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -458,8 +458,13 @@ all_fakegem_compile() {
                                rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to 
(re)build documentation"
                                ;;
                        rdoc)
-                               rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed 
to (re)build documentation"
-                               rm -f doc/js/*.gz || die "failed to remove 
duplicated compressed javascript files"
+                               rdoc=$(type -p rdoc)
+                               if [[ -x ${rdoc} ]]; then
+                                       ${rdoc} ${RUBY_FAKEGEM_DOC_SOURCES} || 
die "failed to (re)build documentation"
+                                       rm -f doc/js/*.gz || die "failed to 
remove duplicated compressed javascript files"
+                               else
+                                       ewarn "No executable rdoc found, 
skipping documentation"
+                               fi
                                ;;
                        yard)
                                yard doc ${RUBY_FAKEGEM_DOC_SOURCES} || die 
"failed to (re)build documentation"
-- 
2.35.1


Reply via email to