Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-15-SP6' into tw_fix_old_repo…
Browse files Browse the repository at this point in the history
…_refresh
  • Loading branch information
lslezak committed Oct 31, 2023
2 parents 7ec50d3 + 01c2af1 commit a624bf3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 13 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:

strategy:
fail-fast: false
matrix:
distro: [ "tumbleweed", "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
Expand All @@ -37,8 +35,6 @@ jobs:

# send the coverage report to coveralls.io
- name: Coveralls Report
# send it only from the TW build to avoid duplicate submits
if: ${{ matrix.distro == 'tumbleweed' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -48,8 +44,6 @@ jobs:

strategy:
fail-fast: false
matrix:
distro: [ "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
Expand All @@ -67,8 +61,6 @@ jobs:

strategy:
fail-fast: false
matrix:
distro: [ "tumbleweed", "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
Expand All @@ -89,8 +81,6 @@ jobs:

strategy:
fail-fast: false
matrix:
distro: [ "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
Expand All @@ -110,8 +100,6 @@ jobs:

strategy:
fail-fast: false
matrix:
distro: [ "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
Expand Down
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 31 12:40:00 UTC 2023 - Ladislav Slezák <[email protected]>

- Refresh repositories with changed URL and reload them again
to activate the changes (related to bsc#1215884)
- 5.0.2

-------------------------------------------------------------------
Tue Sep 5 09:41:29 UTC 2023 - Josef Reidinger <[email protected]>

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

Name: yast2-installation
Version: 5.0.1
Version: 5.0.2
Release: 0
Summary: YaST2 - Installation Parts
License: GPL-2.0-only
Expand Down
4 changes: 4 additions & 0 deletions src/lib/installation/clients/inst_upgrade_urls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

require "yast"
require "installation/upgrade_repo_manager"
require "y2packager/medium_type"
require "y2packager/repository"

Yast.import "GetInstArgs"
Expand Down Expand Up @@ -297,6 +298,9 @@ def save_pkg_mgr
# do not save the changes in the test mode
Pkg.SourceSaveAll unless test?

# reload repositories only when using the openSUSE Leap media
Pkg.SourceLoad if Y2Packager::MediumType.standard?

# clear the old repositories
Y2Packager::OriginalRepositorySetup.instance.repositories.clear
end
Expand Down
9 changes: 9 additions & 0 deletions src/lib/installation/upgrade_repo_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ def activate_changes
update_urls
process_repos
remove_services

# reload the package manager to activate the changes
Yast::Pkg.SourceSaveAll
Yast::Pkg.SourceFinishAll
Yast::Pkg.SourceRestore
Yast::Pkg.SourceLoad
end

private
Expand Down Expand Up @@ -167,6 +173,9 @@ def process_repos
def update_urls
new_urls.each do |repo, url|
repo.url = url

# if the repository will be enabled refresh the content
Yast::Pkg.SourceForceRefreshNow(repo.repo_id) if status_map[repo] == :enabled
end
end

Expand Down
2 changes: 2 additions & 0 deletions test/lib/clients/inst_upgrade_urls_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
allow(Yast::UI).to receive(:QueryWidget)
allow(Yast::UI).to receive(:ChangeWidget)
allow(Yast::Pkg).to receive(:SourceSaveAll)
allow(Y2Packager::MediumType).to receive(:standard?).and_return(true)
allow(Yast::Pkg).to receive(:SourceLoad)
end

describe "#main" do
Expand Down
4 changes: 4 additions & 0 deletions test/lib/upgrade_repo_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def self.is_registered?
allow(repo1).to receive(:disable!)
allow(repo1).to receive(:delete!)
allow(Yast::Pkg).to receive(:ServiceDelete)
allow(Yast::Pkg).to receive(:SourceSaveAll)
allow(Yast::Pkg).to receive(:SourceFinishAll)
allow(Yast::Pkg).to receive(:SourceRestore)
allow(Yast::Pkg).to receive(:SourceLoad)
end

it "removes the selected repositories" do
Expand Down

0 comments on commit a624bf3

Please sign in to comment.