diff options
author | Hans de Graaff <hans@degraaff.org> | 2023-07-15 12:13:07 +0200 |
---|---|---|
committer | Hans de Graaff <hans@degraaff.org> | 2023-07-15 12:13:07 +0200 |
commit | 83d7348865c618425c204feac3871cfac3e978f5 (patch) | |
tree | 36d8e2908aa9cf8b918cd7b4f8a929e071c2b068 /net-analyzer | |
parent | net-analyzer/munin-elasticsearch: add github upstream metadata (diff) | |
download | graaff-83d7348865c618425c204feac3871cfac3e978f5.tar.gz graaff-83d7348865c618425c204feac3871cfac3e978f5.tar.bz2 graaff-83d7348865c618425c204feac3871cfac3e978f5.zip |
net-analyzer/munin-elasticsearch: fix compatibility with ruby30
Signed-off-by: Hans de Graaff <hans@degraaff.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/munin-elasticsearch/files/munin-elasticsearch-0.20220303-ruby30.patch | 33 | ||||
-rw-r--r-- | net-analyzer/munin-elasticsearch/munin-elasticsearch-0.20220303-r1.ebuild | 31 |
2 files changed, 64 insertions, 0 deletions
diff --git a/net-analyzer/munin-elasticsearch/files/munin-elasticsearch-0.20220303-ruby30.patch b/net-analyzer/munin-elasticsearch/files/munin-elasticsearch-0.20220303-ruby30.patch new file mode 100644 index 00000000..80e42509 --- /dev/null +++ b/net-analyzer/munin-elasticsearch/files/munin-elasticsearch-0.20220303-ruby30.patch @@ -0,0 +1,33 @@ +commit 2ce5c27b4f909c0b8aa7284736c5e5a18858bea6 +Author: Hans de Graaff <hans@degraaff.org> +Date: Sat Jul 15 12:07:55 2023 +0200 + + Use URI.encode_www_form_component + + URI.escape has been deprecated for a long time and is no longer + available in ruby 3.0 and later versions. + + Fixes #12 + +diff --git a/elasticsearch_ b/elasticsearch_ +index d4d6f32..94e05f5 100755 +--- a/elasticsearch_ ++++ b/elasticsearch_ +@@ -31,7 +31,7 @@ mode = $0.gsub /.*\/elasticsearch_/, "" + + if ARGV[0] == "autoconf" + begin +- node_encode = URI.escape(@node) ++ node_encode = URI.encode_www_form_component(@node) + nodes_d = fetch('/_nodes/'+node_encode); + puts "yes" + exit 0 +@@ -156,7 +156,7 @@ end + data = {}; + + begin +- node_encode = URI.escape(@node) ++ node_encode = URI.encode_www_form_component(@node) + stats = fetch('/_nodes/'+node_encode+'/stats'); + rescue + err.puts "Fetch error" diff --git a/net-analyzer/munin-elasticsearch/munin-elasticsearch-0.20220303-r1.ebuild b/net-analyzer/munin-elasticsearch/munin-elasticsearch-0.20220303-r1.ebuild new file mode 100644 index 00000000..912220c4 --- /dev/null +++ b/net-analyzer/munin-elasticsearch/munin-elasticsearch-0.20220303-r1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +GITHUB_COMMIT="6f3acd096e0e35b5ba182c7e39f4c873f1443602" + +DESCRIPTION="A Munin plugin for monitoring Elasticsearch nodes" +HOMEPAGE="https://github.com/claygregory/munin-elasticsearch" +LICENSE="MIT" + +SRC_URI="https://github.com/claygregory/munin-elasticsearch/archive/${GITHUB_COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${GITHUB_COMMIT}" + +KEYWORDS="~amd64" +SLOT="0" +IUSE="" + +RDEPEND=" + dev-ruby/json + net-analyzer/munin +" + +PATCHES=( "${FILESDIR}/${P}-ruby30.patch" ) + +src_install() { + default + + exeinto /usr/libexec/munin/plugins + doexe elasticsearch_ +} |