Skip to content

Commit

Permalink
Adjust PkgFinishClient to use Y2Packager classes
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Aug 21, 2017
1 parent fd3ff9e commit 5bc5a7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/lib/packager/clients/pkg_finish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ------------------------------------------------------------------------------

require "installation/finish_client"
require "packages/repository"
require "y2packager/repository"
require "packager/cfa/zypp_conf"

module Yast
Expand Down Expand Up @@ -143,9 +143,9 @@ def backup_all_target_sources
# * if some product contained is not available through another
# repository, then it will be left untouched.
#
# @return [Array<Packages::Repository>] List of disabled repositories
# @return [Array<Y2Packager::Repository>] List of disabled repositories
def disable_local_repos
candidates_repos, other_repos = *::Packages::Repository.enabled.partition(&:local?)
candidates_repos, other_repos = *::Y2Packager::Repository.enabled.partition(&:local?)
products = other_repos.map(&:products).flatten.uniq
candidates_repos.each_with_object([]) do |repo, disabled|
if repo.products.empty?
Expand Down
12 changes: 6 additions & 6 deletions test/pkg_finish_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_relative "test_helper"
require "packager/clients/pkg_finish"
require "packages/repository"
require "y2packager/repository"
require "uri"
require "tmpdir"
require "fileutils"
Expand All @@ -21,7 +21,7 @@

before do
allow(Yast::WFM).to receive(:Args).and_return(args)
allow(::Packages::Repository).to receive(:enabled).and_return(repositories)
allow(::Y2Packager::Repository).to receive(:enabled).and_return(repositories)
allow(Yast::ProductFeatures).to receive(:GetBooleanFeature)
.with("software", "minimalistic_libzypp_config")
.and_return(minimalistic_libzypp_config)
Expand Down Expand Up @@ -77,22 +77,22 @@
let(:repositories) { [local_repo, remote_repo] }

let(:local_repo) do
Packages::Repository.new(repo_id: 1, name: "SLE-12-SP2-0", enabled: true,
Y2Packager::Repository.new(repo_id: 1, name: "SLE-12-SP2-0", enabled: true,
url: URI("cd://dev/sr0"), autorefresh: false)
end

let(:remote_repo) do
Packages::Repository.new(repo_id: 2, name: "SLE-12-SP2-Pool", enabled: true,
Y2Packager::Repository.new(repo_id: 2, name: "SLE-12-SP2-Pool", enabled: true,
url: URI("http://download.suse.com/sle-12-sp2"), autorefresh: true)
end

let(:sles_product) do
Packages::Product.new(name: "SLES", version: "12.2",
Y2Packager::Product.new(name: "SLES", version: "12.2",
arch: "x86_64", category: "base", status: :available, vendor: "SUSE")
end

let(:sles_ha_product) do
Packages::Product.new(name: "SLESHA", version: "12.2",
Y2Packager::Product.new(name: "SLESHA", version: "12.2",
arch: "x86_64", category: "base", status: :available, vendor: "SUSE")
end

Expand Down

0 comments on commit 5bc5a7e

Please sign in to comment.