Skip to content

Commit 3b22df1

Browse files
committed
(PA-5430) Patch augeas C extension
This issue is very similar to PA-4844 (#620) except it affects augeas instead of selinux When puppet is run with Ruby 3.2, this warning is generated: `/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/augeas.rb:48: warning: undefining the allocator of T_DATA class Augeas` This commit patches the autogenerated augeas C extension so there is no warning for augeas
1 parent b14bfcc commit 3b22df1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

configs/components/_base-ruby-augeas.rb

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# load it with instance_eval. See ruby-x.y-augeas.rb configs.
44
#
55

6+
pkg.add_source("file://resources/patches/augeas/ruby-augeas-0.5.0-patch_c_extension.patch")
7+
68
# These can be overridden by the including component.
79
ruby_version ||= settings[:ruby_version]
810
host_ruby ||= settings[:host_ruby]
@@ -72,6 +74,9 @@
7274

7375
pkg.build do
7476
build_commands = []
77+
if ruby_version =~ /^3/
78+
build_commands << "#{platform.patch} --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_c_extension.patch"
79+
end
7580
build_commands << "#{ruby} ext/augeas/extconf.rb"
7681
build_commands << "#{platform[:make]} -e -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"
7782

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/ruby-augeas-0.5.0/ext/augeas/_augeas.c b/ruby-augeas-0.5.0/ext/augeas/_augeas.c
2+
index 95d9e05024..7aac0eb96d 100644
3+
--- a/ruby-augeas-0.5.0/ext/augeas/_augeas.c
4+
+++ b/ruby-augeas-0.5.0/ext/augeas/_augeas.c
5+
@@ -489,6 +489,7 @@ void Init__augeas() {
6+
7+
/* Define the ruby class */
8+
c_augeas = rb_define_class("Augeas", rb_cObject) ;
9+
+ rb_undef_alloc_func(c_augeas);
10+
11+
/* Constants for enum aug_flags */
12+
#define DEF_AUG_FLAG(name) \

0 commit comments

Comments
 (0)