Skip to content

Commit ccf87c3

Browse files
committed
Add backward compatible fallback
1 parent 548c412 commit ccf87c3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/native-package-installer.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ def initialize(spec)
3636
end
3737

3838
def install
39-
@spec.each do |platform_id, system_packages|
39+
spec = @spec.dup
40+
if @platform.target?("fedora")
41+
spec[:fedora] ||= spec[:rhel] || spec[:redhat]
42+
elsif @platform.target?("amazon_linux_2023")
43+
spec[:amazon_linux_2023] ||=
44+
spec[:amazon_linux] || spec[:fedora] || spec[:rhel] || spec[:redhat]
45+
end
46+
spec.each do |platform_id, system_packages|
4047
next unless @platform.target?(platform_id.to_s)
4148
system_packages = [system_packages] unless system_packages.is_a?(Array)
4249
requirement =

0 commit comments

Comments
 (0)