Skip to content

Commit

Permalink
Merge pull request #642 from yast/service_fix_sp6
Browse files Browse the repository at this point in the history
[SLE-15-SP6] Properly save the repo file (bsc#1214135)
  • Loading branch information
lslezak committed Sep 20, 2023
2 parents af4d29a + a69c645 commit a0d058f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
9 changes: 9 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Sep 20 09:08:59 UTC 2023 - Ladislav Slezák <lslezak@suse.com>

- Properly save the repo file when changing URL of a repository
from a service (bsc#1214135)
- Also display a warning when changing URL of a service repository,
the change might be lost after the service is refreshed
- 4.6.4

-------------------------------------------------------------------
Fri Sep 01 19:57:03 UTC 2023 - Josef Reidinger <jreidinger@suse.com>

Expand Down
10 changes: 5 additions & 5 deletions package/yast2-packager.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 4.6.3
Version: 4.6.4
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand All @@ -38,8 +38,8 @@ BuildRequires: yast2-storage-ng >= 4.0.141
#!BuildIgnore: yast2-packager
# Replace PackageSystem with Package
BuildRequires: yast2 >= 4.4.38
# raw_name
BuildRequires: yast2-pkg-bindings >= 4.2.8
# "service" attribute in Pkg.SourceEditSet()
BuildRequires: yast2-pkg-bindings >= 4.6.4
# yast/rspec/helpers.rb
BuildRequires: yast2-ruby-bindings >= 4.4.7
# Augeas lenses
Expand All @@ -48,8 +48,8 @@ BuildRequires: ruby-solv

# Newly added RPM
Requires: yast2-country-data >= 2.16.3
# raw_name
Requires: yast2-pkg-bindings >= 4.2.8
# "service" attribute in Pkg.SourceEditSet()
Requires: yast2-pkg-bindings >= 4.6.4
# Replace PackageSystem with Package
Requires: yast2 >= 4.4.38
# unzipping license file
Expand Down
9 changes: 7 additions & 2 deletions src/lib/packager/clients/repositories.rb
Expand Up @@ -1854,6 +1854,8 @@ def repo_replace_handler(source_state, global_current)
end

if !same_url || plaindir != SourceDialogs.IsPlainDir
warn_service_repository(source_state)

Builtins.y2milestone(
"URL or plaindir flag changed, recreating the source"
)
Expand Down Expand Up @@ -1896,20 +1898,23 @@ def repo_replace_handler(source_state, global_current)
"priority",
@default_priority
)
service = source_state["service"] || ""
Builtins.y2milestone(
"Restoring the original properties: enabled: %1, autorefresh: %2, " \
"keeppackages: %3, priority: %4",
"keeppackages: %3, priority: %4, service: %5",
enabled,
auto_refresh,
keeppackages,
priority
priority,
service
)

# set the original properties
Ops.set(addedSource, "autorefresh", auto_refresh)
Ops.set(addedSource, "keeppackages", keeppackages)
Ops.set(addedSource, "enabled", enabled)
Ops.set(addedSource, "priority", priority)
Ops.set(addedSource, "service", service)

# get the ID of the old repo and mark it for removal
srcid = Ops.get_integer(
Expand Down

0 comments on commit a0d058f

Please sign in to comment.