Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Disable empty Online medium repository (bsc#1182303) #646

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 9 13:39:32 UTC 2024 - Ladislav Slezák <[email protected]>

- 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 <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading