Skip to content

Commit

Permalink
Merge pull request puppetlabs#849 from joshcooper/future_proof
Browse files Browse the repository at this point in the history
Future proof ruby-selinux
  • Loading branch information
AriaXLi authored Jun 20, 2024
2 parents a7fc904 + 6ecff8b commit a49f32a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions configs/components/_base-ruby-selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@
]

if ruby_version =~ /^3/
# swig 4.1 generated interface does not need patching
unless platform.name =~ /^(debian-12|ubuntu-24|fedora-40)/
# swig 4.1 generated interface does not need patching, so skip
# when running debian >= 12, fedora >= 40, etc
unless (platform.is_debian? && platform.os_version.to_i >= 12) ||
(platform.is_fedora? && platform.os_version.to_i >= 40) ||
(platform.is_ubuntu? && platform.os_version.to_i >= 24)
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_wrap.patch"
end
# EL 7 uses an older version of swig (2.0) so a different patch is needed to
Expand All @@ -90,7 +93,8 @@
else
# Ubuntu 24 & Fedora 40 use a newer swig that already has the fix that's
# being patched
unless platform.name =~ /^(ubuntu-24|fedora-40)/
unless (platform.is_fedora? && platform.os_version.to_i >= 40) ||
(platform.is_ubuntu? && platform.os_version.to_i >= 24)
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_undefining_allocator.patch"
end
end
Expand Down

0 comments on commit a49f32a

Please sign in to comment.