Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SLE-9109] Packages online search #501

Merged
merged 4 commits into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 17 14:21:38 UTC 2020 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Enable the online_search if system is registered (jsc#SLE-9109).
- 4.2.45

-------------------------------------------------------------------
Thu Jan 10 15:03:31 UTC 2020 - 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: 4.2.44
Version: 4.2.45
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand Down
21 changes: 20 additions & 1 deletion src/clients/sw_single.rb
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,12 @@ def GetPackagerOptions
end
end
repo_management = Mode.normal if repo_management.nil?
online_search = Mode.normal && registered?

ret = { "mode" => mode, "enable_repo_mgr" => repo_management }
ret = {
"mode" => mode, "enable_repo_mgr" => repo_management,
"enable_online_search" => online_search
}

Builtins.y2milestone("PackagesUI::RunPackageSelector() options: %1", ret)

Expand Down Expand Up @@ -615,6 +619,9 @@ def StartSWSingle
)
end
force_restart = true
elsif result == :online_search
WFM.CallFunction("online_search", [:sw_single_mode])
force_restart = true
elsif result == :webpin
required_package = "yast2-packager-webpin"

Expand Down Expand Up @@ -794,6 +801,18 @@ def StartSWSingle

result
end

private

# Determines whether the running system is registered or not
#
# @return [Booolean] true if the system is registered; false otherwise
def registered?
require "registration/registration"
::Registration::Registration.is_registered?
rescue LoadError
false
end
end
end

Expand Down