From 48f63c5b7470e31ffb1c5db8c055f45aa5788a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 10 Sep 2023 13:53:48 +0200 Subject: [PATCH] discourseAllPlugins.plugins.discourse-prometheus: Update ABI patch --- .../spec-import-fix-abi-version.patch | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/spec-import-fix-abi-version.patch b/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/spec-import-fix-abi-version.patch index 7b1159d0a800..de3a5c718f00 100644 --- a/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/spec-import-fix-abi-version.patch +++ b/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/spec-import-fix-abi-version.patch @@ -1,16 +1,20 @@ diff --git a/bin/collector b/bin/collector -index 4fec65e..e59eac7 100755 +index 6bd04a8caffb..119526fc6ea3 100644 --- a/bin/collector +++ b/bin/collector -@@ -3,8 +3,10 @@ +@@ -3,12 +3,14 @@ Process.setproctitle("discourse prometheus-collector") +# We need the ABI version {MAJOR}.{MINOR}.0 here. +abi_version = ENV['GEM_PATH'].split("/")[-1] - version = File.read(File.expand_path("../../prometheus_exporter_version", __FILE__)).strip --spec_file = File.expand_path("../../gems/#{RUBY_VERSION}/specifications/prometheus_exporter-#{version}.gemspec", __FILE__) -+spec_file = File.expand_path("../../gems/#{abi_version}/specifications/prometheus_exporter-#{version}.gemspec", __FILE__) - - spec = Gem::Specification.load spec_file - spec.activate + [ + "webrick-#{ENV["WEBRICK_VERSION"]}", + "prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}", + ].each do |spec_name| + spec_file = +- File.expand_path("../../gems/#{RUBY_VERSION}/specifications/#{spec_name}.gemspec", __FILE__) ++ File.expand_path("../../gems/#{abi_version}/specifications/#{spec_name}.gemspec", __FILE__) + spec = Gem::Specification.load(spec_file) + spec.activate + end