summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2017-06-27 10:53:25 -0500
committerMatthew Thode <prometheanfire@gentoo.org>2017-06-27 10:53:57 -0500
commit33214a8b309b90f280b40816e5b84c14d13b74a7 (patch)
tree418147d1235c3a146400c85f7c64b4c8c640a714 /dev-ruby/facter
parentprofiles/arch/arm64: unmask gnome-keyring useflag as it prevents testing it more (diff)
downloadgentoo-33214a8b309b90f280b40816e5b84c14d13b74a7.tar.gz
gentoo-33214a8b309b90f280b40816e5b84c14d13b74a7.tar.bz2
gentoo-33214a8b309b90f280b40816e5b84c14d13b74a7.zip
dev-ruby/facter: fix building with leatherman-1.0.0
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'dev-ruby/facter')
-rw-r--r--dev-ruby/facter/facter-3.6.5.ebuild3
-rw-r--r--dev-ruby/facter/files/is-integer_fact-1624_3.6.5.patch58
2 files changed, 60 insertions, 1 deletions
diff --git a/dev-ruby/facter/facter-3.6.5.ebuild b/dev-ruby/facter/facter-3.6.5.ebuild
index 47f77c3cc1a3..c4b3000acb22 100644
--- a/dev-ruby/facter/facter-3.6.5.ebuild
+++ b/dev-ruby/facter/facter-3.6.5.ebuild
@@ -4,7 +4,7 @@
EAPI=5
USE_RUBY="ruby21 ruby22"
-inherit cmake-utils multilib ruby-ng
+inherit cmake-utils eutils multilib ruby-ng
DESCRIPTION="A cross-platform ruby library for retrieving facts from operating systems"
HOMEPAGE="http://www.puppetlabs.com/puppet/related-projects/facter/"
@@ -43,6 +43,7 @@ src_prepare() {
# make the require work
sed -i 's/\${LIBFACTER_INSTALL_DESTINATION}\///g' lib/facter.rb.in || die
# patches
+ epatch "${FILESDIR}/is-integer_fact-1624_3.6.5.patch"
epatch_user
}
diff --git a/dev-ruby/facter/files/is-integer_fact-1624_3.6.5.patch b/dev-ruby/facter/files/is-integer_fact-1624_3.6.5.patch
new file mode 100644
index 000000000000..c7b8d80b2c73
--- /dev/null
+++ b/dev-ruby/facter/files/is-integer_fact-1624_3.6.5.patch
@@ -0,0 +1,58 @@
+From 9cb17d9fdffabab3693f6548f6bfc54ed2251325 Mon Sep 17 00:00:00 2001
+From: Maggie Dreyer <maggie@puppet.com>
+Date: Tue, 2 May 2017 10:21:06 -0700
+Subject: [PATCH] (FACT-1624) Use `is_integer` instead of `is_fixednum` and
+ `is_bignum`
+
+Ruby 2.4 unified Fixnum and Bignum into Integer. We updated the
+Leatherman API to match this. This commit updates Facter to use the new
+API.
+---
+ lib/src/ruby/module.cc | 2 +-
+ lib/src/ruby/ruby_value.cc | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/src/ruby/module.cc b/lib/src/ruby/module.cc
+index 2d7223e0f..b8aeeed09 100644
+--- a/lib/src/ruby/module.cc
++++ b/lib/src/ruby/module.cc
+@@ -866,7 +866,7 @@ namespace facter { namespace ruby {
+ // Unfortunately we have to call to_sym rather than using ID2SYM, which is Ruby version dependent
+ uint32_t timeout = 0;
+ volatile VALUE timeout_option = ruby.rb_hash_lookup(argv[1], ruby.to_symbol("timeout"));
+- if (ruby.is_fixednum(timeout_option)) {
++ if (ruby.is_integer(timeout_option)) {
+ timeout = ruby.num2size_t(timeout_option);
+ }
+
+diff --git a/lib/src/ruby/ruby_value.cc b/lib/src/ruby/ruby_value.cc
+index d8ea20ce6..645472a3f 100644
+--- a/lib/src/ruby/ruby_value.cc
++++ b/lib/src/ruby/ruby_value.cc
+@@ -86,7 +86,7 @@ namespace facter { namespace ruby {
+ json.SetString(str, size, allocator);
+ return;
+ }
+- if (ruby.is_fixednum(value) || ruby.is_bignum(value)) {
++ if (ruby.is_integer(value)) {
+ json.SetInt64(ruby.rb_num2ll(value));
+ return;
+ }
+@@ -155,7 +155,7 @@ namespace facter { namespace ruby {
+ }
+ return;
+ }
+- if (ruby.is_fixednum(value) || ruby.is_bignum(value)) {
++ if (ruby.is_integer(value)) {
+ os << ruby.rb_num2ll(value);
+ return;
+ }
+@@ -241,7 +241,7 @@ namespace facter { namespace ruby {
+ emitter << str;
+ return;
+ }
+- if (ruby.is_fixednum(value) || ruby.is_bignum(value)) {
++ if (ruby.is_integer(value)) {
+ emitter << ruby.rb_num2ll(value);
+ return;
+ }