Skip to content

Commit

Permalink
fixed setting the repository status (bnc#875839)
Browse files Browse the repository at this point in the history
to properly enable e.g. the *-Pool repositories

- 3.1.48
  • Loading branch information
lslezak committed May 7, 2014
1 parent 7319d63 commit 81e8760
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 7 11:38:30 UTC 2014 - lslezak@suse.cz

- fixed setting the repository status (to properly enable e.g. the
*-Pool repositories) (bnc#875839)
- 3.1.48

-------------------------------------------------------------------
Tue May 6 12:38:51 UTC 2014 - lslezak@suse.cz

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


Name: yast2-registration
Version: 3.1.47
Version: 3.1.48
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
24 changes: 18 additions & 6 deletions src/lib/registration/sw_mgmt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def self.base_product_label(base_product)

def self.base_product_to_register
# just for debugging:
# return {"name" => "SLES", "arch" => "x86_64", "version" => "12",
# "release_type" => "DVD"
# }
return {"name" => "SLES", "arch" => "x86_64", "version" => "12",
"release_type" => "DVD"
}

base_product = find_base_product

Expand Down Expand Up @@ -188,8 +188,14 @@ def self.add_services(product_services, credentials)
end

# activate the requested repository setup
repos_enable(product_services.map(&:enabled).flatten)
repos_disable_autorefresh(product_services.map(&:norefresh).flatten)
product_services.each do |product_service|
# there is only one service
service_name = product_service.sources.first.name
log.info "Updating repositories for service: #{service_name}"

repos_enable(service_aliases(service_name, product_service.enabled))
repos_disable_autorefresh(service_aliases(service_name, product_service.norefresh))
end
ensure
Pkg.SourceSaveAll
end
Expand Down Expand Up @@ -274,8 +280,14 @@ def self.each_repo(repo_aliases, &block)
end
end
end

# get libzypp repository aliases for a service
# (libzypp internally uses the service name as the prefix)
def self.service_aliases(service, aliases)
aliases.map{ |a| "#{service}:#{a}"}
end

private_class_method :each_repo
private_class_method :each_repo, :service_aliases
end
end

0 comments on commit 81e8760

Please sign in to comment.