Skip to content

Commit

Permalink
Updating ruby windows patches (#1914)
Browse files Browse the repository at this point in the history
* Updating ruby windows patches

Signed-off-by: John <[email protected]>

* Updating the registry patch path

Signed-off-by: John McCrae <[email protected]>

---------

Signed-off-by: John <[email protected]>
Signed-off-by: John McCrae <[email protected]>
  • Loading branch information
johnmccrae authored Jun 14, 2024
1 parent a32e7ee commit 28c9c9f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/patches/ruby/ruby-win32_registry.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- "a/ext/win32/lib/win32/registry.rb" 2023-04-01 17:44:16.000000000 +0000
+++ "b/ext/win32/lib/win32/registry.rb" 2024-06-13 21:23:53.522771500 +0000
@@ -906,7 +906,7 @@

private

- def export_string(str, enc = Encoding.default_internal || LOCALE) # :nodoc:
+ def export_string(str, enc = Encoding.default_internal || "utf-8") # :nodoc:
str.encode(enc)
end
end
8 changes: 8 additions & 0 deletions config/software/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@
if windows? && version.satisfies?("~> 3.0.0")
patch source: "ruby-win32_resolv.patch", plevel: 0, env: patch_env
end

# Prior to Chef-18, we had been monkeypatching the registry.rb to solve a registry encoding
# problem. We had to move that patch here. We also patch the resolv class here as insurance.
if windows? && version.satisfies?("~> 3.1")
patch source: "ruby-win32_registry.patch", plevel: 1, env: patch_env
patch source: "ruby-win32_resolv.patch", plevel: 0, env: patch_env
end

if suse? && version.satisfies?("= 3.1.4")
patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env
end
Expand Down

0 comments on commit 28c9c9f

Please sign in to comment.