Skip to content

Commit

Permalink
Base product selection according to packages list in the profile
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Oct 16, 2017
1 parent e1184c3 commit 44d81ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/AutoinstConfig.rb
Expand Up @@ -547,13 +547,20 @@ def selected_product
product_name = software.fetch("products", {})["product"]
return base_products.find { |p| p.short_name == product_name } if product_name

# try to find product according to patterns in profile
# try to find base product according to patterns in profile
# searching for patterns like "sles-base-32bit"
products = base_products.select do |product|
software["patterns"].any? { |p| p =~ /#{product.name.downcase}-.*/ }
end
return products.first if products.size == 1

# try to find base product according to packages selection in profile
# searching for packages like "sles-release"
products = base_products.select do |product|
software["packages"].any? { |p| p =~ /#{product.name.downcase}-release/ }
end
return products.first if products.size == 1

# last instance
return base_products.first if base_products.size == 1

Expand Down

0 comments on commit 44d81ef

Please sign in to comment.