diff --git a/library/packages/src/modules/PackageSystem.rb b/library/packages/src/modules/PackageSystem.rb index 80960eef9..efcf2b18c 100644 --- a/library/packages/src/modules/PackageSystem.rb +++ b/library/packages/src/modules/PackageSystem.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/package/yast2.changes b/package/yast2.changes index 33928df08..5d4b678b0 100644 --- a/package/yast2.changes +++ b/package/yast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 3 14:11:43 UTC 2022 - Ladislav Slezák + +- 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 diff --git a/package/yast2.spec b/package/yast2.spec index 92e6fe039..fa7d0d422 100644 --- a/package/yast2.spec +++ b/package/yast2.spec @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.3.68 +Version: 4.3.69 Release: 0 Summary: YaST2 Main Package