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 3/3] ruby-fakegem.eclass: warn about using the fallback gemspec
Date: Thu, 25 Jul 2019 07:09:29
Message-Id: 20190725070916.8364-3-graaff@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] ruby-fakegem.eclass: enable EAPI 7 by Hans de Graaff
1 The fallback gemspec does not contain dependencies so it will only
2 work for packages without any runtime gem dependencies. It is easy to
3 use it by mistake when switching from a gem to a source-based archive,
4 because the source-based archive does not contain the generated
5 metadata, but RUBY_FAKEGEM_GEMSPEC has not been set yet. This warning
6 alerts developers to this situation and encourages them to set
7 RUBY_FAKEGEM_GEMSPEC instead.
8
9 Signed-off-by: Hans de Graaff <graaff@g.o>
10 ---
11 eclass/ruby-fakegem.eclass | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14 diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
15 index 33a9e453f564..a6a7654f9e6d 100644
16 --- a/eclass/ruby-fakegem.eclass
17 +++ b/eclass/ruby-fakegem.eclass
18 @@ -295,6 +295,15 @@ ruby_fakegem_metadata_gemspec() {
19 # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
20 # See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths.
21 ruby_fakegem_genspec() {
22 + case ${EAPI} in
23 + 4|5|6) ;;
24 + *)
25 + eqawarn "Generating generic fallback gemspec *without* dependencies"
26 + eqawarn "This will only work when there are no runtime dependencies"
27 + eqawarn "Set RUBY_FAKEGEM_GEMSPEC to generate a proper specifications file"
28 + ;;
29 + esac
30 +
31 local required_paths="'lib'"
32 for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do
33 required_paths="${required_paths}, '${path}'"
34 --
35 2.21.0