Skip to content

Commit

Permalink
Merge pull request #1247 from yast/repo_fix_sp3
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak authored Mar 15, 2022
2 parents eed423e + 50b1ae9 commit 29eda8e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
19 changes: 8 additions & 11 deletions library/packages/src/modules/PackageSystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ def main
# Has Pkg::TargetInit run?
@target_initialized = false

# Has Pkg::SourceStartCache run?
@source_initialized = false

Yast.include self, "packages/common.rb"

@_rpm_query_binary_initialized = false
Expand Down Expand Up @@ -94,7 +91,8 @@ def EnsureTargetInit
def EnsureSourceInit
PackageLock.Check

if @source_initialized
# no repository present (not even a disabled one)
if Pkg.SourceGetCurrent(false).empty?
# this way, if somebody closed the cache outside of Package
# (typically in installation), we will reinitialize
# it's cheap if cache is already initialized
Expand All @@ -107,11 +105,8 @@ def EnsureSourceInit
EnsureTargetInit()
end

sources = Pkg.SourceStartCache(true)

if Ops.greater_than(Builtins.size(sources), 0)
@source_initialized = true
else
# at least one enabled repository?
if Pkg.SourceGetCurrent(true).empty?
# all repositories are disabled or no repository defined
Builtins.y2warning("No package repository available")
end
Expand Down Expand Up @@ -310,7 +305,8 @@ def DoInstallAndRemove(toinstall, toremove)
def Available(package)
EnsureSourceInit()

if !@source_initialized
# at least one enabled repository present?
if Pkg.SourceGetCurrent(true).empty?
# error no source initialized
return nil
end
Expand Down Expand Up @@ -379,7 +375,8 @@ def PackageInstalled(package)
def PackageAvailable(package)
EnsureSourceInit()

if !@source_initialized
# at least one enabled repository present?
if Pkg.SourceGetCurrent(true).empty?
# error no source initialized
return nil
end
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Mar 3 14:11:43 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Fixed refreshing old repositories during system upgrade
(bsc#1196120, similar to bsc#1190228)
- 4.3.69

-------------------------------------------------------------------
Thu Feb 17 09:33:37 UTC 2022 - Steffen Winterfeldt <snwint@suse.com>

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


Name: yast2
Version: 4.3.68
Version: 4.3.69

Release: 0
Summary: YaST2 Main Package
Expand Down

0 comments on commit 29eda8e

Please sign in to comment.