Gentoo Archives: gentoo-dev

From: Hans de Graaff <graaff@g.o>
To: gentoo-dev@l.g.o
Cc: Hans de Graaff <graaff@g.o>
Subject: [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: guard against broken rdoc
Date: Fri, 15 Jul 2022 10:17:34
Message-Id: 20220715101724.3172-1-graaff@gentoo.org
1 Skip building documentation rather than generating an error when rdoc is
2 missing but documentation is requested. rdoc should not be missing
3 normally, but this is a common problem when updating from one ruby
4 target straight to another one. There can be a gap when eselect has not
5 been triggered again yet for rdoc and another core ruby package may
6 require rdoc. This is commonly bundler since it has a +doc USE flag.
7
8 Signed-off-by: Hans de Graaff <graaff@g.o>
9 ---
10 eclass/ruby-fakegem.eclass | 9 +++++++--
11 1 file changed, 7 insertions(+), 2 deletions(-)
12
13 diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
14 index 6f561f4f6a2f..64c285d70559 100644
15 --- a/eclass/ruby-fakegem.eclass
16 +++ b/eclass/ruby-fakegem.eclass
17 @@ -458,8 +458,13 @@ all_fakegem_compile() {
18 rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
19 ;;
20 rdoc)
21 - rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
22 - rm -f doc/js/*.gz || die "failed to remove duplicated compressed javascript files"
23 + rdoc=$(type -p rdoc)
24 + if [[ -x ${rdoc} ]]; then
25 + ${rdoc} ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
26 + rm -f doc/js/*.gz || die "failed to remove duplicated compressed javascript files"
27 + else
28 + ewarn "No executable rdoc found, skipping documentation"
29 + fi
30 ;;
31 yard)
32 yard doc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
33 --
34 2.35.1

Replies