Skip to content

Commit

Permalink
Disable the empty repository from the Online medium (bsc#1182303)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 9, 2024
2 parents 4e7687c + 755e85c commit c7eab70
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 9 13:39:32 UTC 2024 - Ladislav Slezák <lslezak@suse.com>

- After installation disable the empty installation repository
from the SLE15 Online medium (bsc#1182303)
- 5.0.2

-------------------------------------------------------------------
Wed Sep 20 15:58:33 UTC 2023 - Ladislav Slezák <lslezak@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 5.0.1
Version: 5.0.2
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand Down
6 changes: 5 additions & 1 deletion src/lib/packager/clients/pkg_finish.rb
Expand Up @@ -13,6 +13,7 @@

require "installation/finish_client"
require "y2packager/repository"
require "y2packager/resolvable"
require "packager/cfa/zypp_conf"
require "packager/cfa/dnf_conf"

Expand Down Expand Up @@ -192,7 +193,10 @@ def disable_local_repos
log.info "Not installed base products: #{non_installed_base.map(&:name)} "

local_repos.each_with_object([]) do |repo, disabled|
if repo.products.empty?
# No product but the repository is not empty => most likely a 3rd party
# repository, do not touch it.
# The empty repository on the SLE Online medium is disabled by the code below.
if repo.products.empty? && Y2Packager::Resolvable.any?(kind: :package, source: repo.repo_id)
log.info("Repo #{repo.repo_id} (#{repo.name}) does not have products; ignored")
next
end
Expand Down
4 changes: 3 additions & 1 deletion test/pkg_finish_test.rb
Expand Up @@ -184,6 +184,7 @@
.to receive(:GetBooleanFeature)
.with("software", "disable_media_repo")
.and_return(true)
allow(Y2Packager::Resolvable).to receive(:any?).and_return(false)
end

context "dvd repo is disabled even if base products aren't available using other repos" do
Expand Down Expand Up @@ -226,9 +227,10 @@
end
end

context "if does not contain any product" do
context "if does not contain any product but is not empty" do
before do
allow(local_repo).to receive(:products).and_return([])
allow(Y2Packager::Resolvable).to receive(:any?).and_return(true)
end

it "does not disable the local repository" do
Expand Down

0 comments on commit c7eab70

Please sign in to comment.