From 0cd19d49719d4092203d49e14dac4adaaa3c4f97 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Sat, 31 Aug 2024 07:07:35 +0530 Subject: [PATCH] Revert "(PA-6900) Update ruby-augeas to 0.6.0" --- configs/components/_base-ruby-augeas.rb | 14 +++++++++++--- .../ruby-augeas-0.5.0-patch_c_extension.patch | 12 ++++++++++++ ...ugeas-0.5.0-patch_remove_unused_parameter.patch | 12 ++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch create mode 100644 resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch diff --git a/configs/components/_base-ruby-augeas.rb b/configs/components/_base-ruby-augeas.rb index e22ec78ab..47ffc5c3c 100644 --- a/configs/components/_base-ruby-augeas.rb +++ b/configs/components/_base-ruby-augeas.rb @@ -3,6 +3,10 @@ # load it with instance_eval. See ruby-x.y-augeas.rb configs. # +pkg.add_source("file://resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch") + +# We can remove the below patch after https://github.com/hercules-team/ruby-augeas/pull/17 is merged. +pkg.add_source("file://resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch") # These can be overridden by the including component. ruby_version ||= settings[:ruby_version] @@ -10,9 +14,9 @@ ruby_dir ||= settings[:ruby_dir] ruby_bindir ||= settings[:ruby_bindir] -pkg.version "0.6.0" -pkg.md5sum "3c2a13b748300b5a984bab9a30e74d0f" -pkg.url "https://github.com/hercules-team/ruby-augeas/releases/download/release-#{pkg.get_version}/ruby-augeas-#{pkg.get_version}.tgz" +pkg.version "0.5.0" +pkg.md5sum "a132eace43ce13ccd059e22c0b1188ac" +pkg.url "http://download.augeas.net/ruby/ruby-augeas-#{pkg.get_version}.tgz" pkg.mirror "#{settings[:buildsources_url]}/ruby-augeas-#{pkg.get_version}.tgz" pkg.build_requires "ruby-#{ruby_version}" @@ -71,6 +75,10 @@ pkg.build do build_commands = [] + if ruby_version =~ /^3/ + build_commands << "#{platform.patch} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_c_extension.patch" + end + build_commands << "#{platform.patch} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_remove_unused_parameter.patch" build_commands << "#{ruby} ext/augeas/extconf.rb" build_commands << "#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)" diff --git a/resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch b/resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch new file mode 100644 index 000000000..7b73f8eb3 --- /dev/null +++ b/resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch @@ -0,0 +1,12 @@ +diff --git a/ruby-augeas-0.5.0/ext/augeas/_augeas.c b/ruby-augeas-0.5.0/ext/augeas/_augeas.c +index 95d9e05024..7aac0eb96d 100644 +--- a/ruby-augeas-0.5.0/ext/augeas/_augeas.c ++++ b/ruby-augeas-0.5.0/ext/augeas/_augeas.c +@@ -489,6 +489,7 @@ void Init__augeas() { + + /* Define the ruby class */ + c_augeas = rb_define_class("Augeas", rb_cObject) ; ++ rb_undef_alloc_func(c_augeas); + + /* Constants for enum aug_flags */ + #define DEF_AUG_FLAG(name) \ diff --git a/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch b/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch new file mode 100644 index 000000000..416ac7b11 --- /dev/null +++ b/resources/patches/augeas/ruby-augeas-0.5.0-patch_remove_unused_parameter.patch @@ -0,0 +1,12 @@ +diff --git a/ext/augeas/_augeas.c b/ext/augeas/_augeas.c +index f9b49d1..7ef0d7d 100644 +--- a/ruby-augeas-0.5.0/ext/augeas/_augeas.c ++++ b/ruby-augeas-0.5.0/ext/augeas/_augeas.c +@@ -184,7 +184,7 @@ VALUE augeas_mv(VALUE s, VALUE src, VALUE dst) { + * + * Remove path and all its children. Returns the number of entries removed + */ +-VALUE augeas_rm(VALUE s, VALUE path, VALUE sibling) { ++VALUE augeas_rm(VALUE s, VALUE path) { + augeas *aug = aug_handle(s); + const char *cpath = StringValueCStr(path) ;