Skip to content

Commit

Permalink
Merge pull request #244 from yast/base_product_fix
Browse files Browse the repository at this point in the history
Product.rb - fixed base product detection (bnc#876836)
  • Loading branch information
lslezak committed May 9, 2014
2 parents cae6028 + 6e15643 commit 4e96d6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
16 changes: 9 additions & 7 deletions library/packages/src/modules/Product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,27 @@ def FindBaseProducts

log.info "Looking for base products"

products = Pkg.ResolvableProperties("", :product, "").dup || []
required_status = use_installed_products? ? :installed : :selected
products.select!{ |p| p["status"] == required_status }

log.info "All #{required_status} products: #{products}"
products = Pkg.ResolvableProperties("", :product, "") || []

# For all (not only base) products
fill_up_relnotes(products)
# TODO FIXME: filling release notes is a nasty side effect of searching the base product,
# it should be handled separately...
required_status = use_installed_products? ? :installed : :selected
fill_up_relnotes(products.select{ |p| p["status"] == required_status })

# Use only base products
products.select! do |p|
# The category "base" is not set during installation yet, it is set
# only for _installed_ base product (otherwise "addon" is reported).
# Use the product from the initial repository during installation.
use_installed_products? ? (p["category"] == "base") : (p["source"] == 0)
end

log.info "Found #{products.size} base product(s)"

if products.empty?
log.error "No base product found"
raise "No #{required_status} base product found"
raise "No base product found"
elsif products.size > 1
log.warn "More than one base product found!"
end
Expand Down
8 changes: 8 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri May 9 07:15:25 UTC 2014 - lslezak@suse.cz

- Product.rb - fixed base product detection (do not check the
product status, always use the product from the initial
repository during installation) (bnc#876836)
- 3.1.61

-------------------------------------------------------------------
Mon May 5 11:38:34 UTC 2014 - vmoravec@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.1.60
Version: 3.1.61
Release: 0
URL: https://github.com/yast/yast-yast2

Expand Down

0 comments on commit 4e96d6f

Please sign in to comment.