Skip to content

Commit

Permalink
Merge 7baa6c0 into 9f460e8
Browse files Browse the repository at this point in the history
  • Loading branch information
gilsonsouza committed Apr 12, 2018
2 parents 9f460e8 + 7baa6c0 commit b2c10a4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
8 changes: 8 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Apr 12 08:17:13 UTC 2018 - gsouza@suse.com

- Added warning to inform the user that volatiles changes in a
repository of a service will be reset in the next service refresh
(bsc#1078323).
- 3.1.124

-------------------------------------------------------------------
Thu Jul 27 11:12:01 CEST 2017 - schubi@suse.de

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: 3.1.123
Version: 3.1.124
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
29 changes: 22 additions & 7 deletions src/clients/repositories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def main
"guihandler" => fun_ref(method(:StartInstSource), "symbol ()")
}

# list of repositories that was already informed to the user that they are
# managed by service
@services_repos = []

if WFM.Args == [:sw_single_mode]
Builtins.y2milestone("Started from sw_single, switching the mode")

Expand Down Expand Up @@ -567,7 +571,7 @@ def Write
Builtins.foreach(deleted_services) do |_alias|
Builtins.y2milestone("Removing service %1", _alias)
success = success && Pkg.ServiceDelete(_alias)
end
end


Builtins.y2milestone("New service config: %1", @serviceStatesOut)
Expand All @@ -589,7 +593,7 @@ def Write
Builtins.y2milestone("Modifying service %1", _alias)
success = success && Pkg.ServiceSet(_alias, s)
end
end
end


Builtins.y2milestone("New repo config: %1", @sourceStatesOut)
Expand Down Expand Up @@ -624,7 +628,7 @@ def Write

success = success && Pkg.SourceRefreshNow(srcid)
end
end
end


success = success && KeyManager.Write
Expand Down Expand Up @@ -1139,7 +1143,7 @@ def SummaryDialog
global_current = Ops.add(global_current, 1)
Ops.get(s, "SrcId") ==
Ops.get_integer(sourceState, "SrcId", -1)
end
end


Builtins.y2milestone("global_current: %1", global_current)
Expand Down Expand Up @@ -1458,7 +1462,7 @@ def SummaryDialog
to_refresh = Ops.add(to_refresh, 1)
end
end
end
end


Builtins.y2milestone(
Expand Down Expand Up @@ -1547,7 +1551,7 @@ def SummaryDialog
Pkg.ServiceRefresh(service_alias)
end
end
end
end


Progress.Finish
Expand Down Expand Up @@ -1669,6 +1673,7 @@ def SummaryDialog
current = -1
elsif input == :priority
if @repository_view
warn_service_repository(sourceState)
# refresh the value in the table
new_priority = Convert.to_integer(
UI.QueryWidget(Id(:priority), :Value)
Expand Down Expand Up @@ -1903,7 +1908,7 @@ def StartInstSource
@serviceStatesIn,
Pkg.ServiceGet(srv_alias)
)
end
end


Builtins.y2milestone("Loaded services: %1", @serviceStatesIn)
Expand Down Expand Up @@ -1939,6 +1944,16 @@ def StartInstSource
UI.CloseDialog
ret
end

def warn_service_repository(source_state)
msg = _("Repo %{name} is managed by service %{service}.\n"\
"Volatile changes are reset by the next service refresh!") % {name: source_state["name"],
service: source_state["service"]}
if source_state["service"] != "" && !@services_repos.include?(source_state["SrcId"])
Popup.Warning(msg)
@services_repos.push(source_state["SrcId"])
end
end
end unless defined? (Yast::RepositoriesClient)
end

Expand Down

0 comments on commit b2c10a4

Please sign in to comment.