Skip to content

Commit

Permalink
install extension products also in installed system (bnc#891891)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Aug 22, 2014
1 parent 8eb6b86 commit 6ca1762
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
36 changes: 35 additions & 1 deletion src/clients/inst_scc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ def register_selected_addons
# select repositories to use in installation (e.g. enable/disable Updates)
select_repositories(product_service) if Mode.installation || Mode.update

# remember the added service
::Registration::Storage::Cache.instance.addon_services << product_service

# move from selected to registered
product.registered
@selected_addons.reject!{|selected| selected.identifier == product.identifier}
Expand Down Expand Up @@ -589,6 +592,31 @@ def update_autoyast_config
:next
end

def pkg_manager
return :next unless Mode.normal

log.info "New addon services: #{::Registration::Storage::Cache.instance.addon_services}"
new_repos = []
::Registration::Storage::Cache.instance.addon_services.each do |service|
new_repos.concat(::Registration::SwMgmt.service_repos(service))
end

if !new_repos.empty?
products = Pkg.ResolvableProperties("", :product, "")
products.select! do |product|
product["status"] == :available && new_repos.any?{|repo| product["source"] == repo["SrcId"]}
end

log.info "Products to install: #{products}"

products.each do |product|
Pkg.ResolvableInstall(product["name"], :product)
end
end

WFM.call("sw_single")
end

# UI workflow definition
def start_workflow
aliases = {
Expand All @@ -599,7 +627,8 @@ def start_workflow
"update" => [ lambda { update_registration() }, true ],
"addon_eula" => lambda { addon_eula() },
"register_addons" => lambda { register_addons() },
"update_autoyast_config" => lambda { update_autoyast_config() }
"update_autoyast_config" => lambda { update_autoyast_config() },
"pkg_manager" => lambda { pkg_manager() }
}

sequence = {
Expand Down Expand Up @@ -639,6 +668,11 @@ def start_workflow
:next => "update_autoyast_config"
},
"update_autoyast_config" => {
:abort => :abort,
:next => "pkg_manager"
},
"pkg_manager" => {
:abort => :abort,
:next => :next
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registration/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ def initialize
end
end

class Cache < Struct.new(:available_addons, :first_run, :registered_addons,
class Cache < Struct.new(:available_addons, :first_run, :addon_services,
:reg_url, :reg_url_cached)

include Singleton

def initialize
self.registered_addons = []
self.addon_services = []
self.first_run = true
end
end
Expand Down

0 comments on commit 6ca1762

Please sign in to comment.