Skip to content

Commit

Permalink
Merge pull request #505 from yast/sle-9109/online-search-available
Browse files Browse the repository at this point in the history
Online Search: display the "Search Online" option in registrable systems
  • Loading branch information
imobachgs committed Feb 5, 2020
2 parents 3ac9137 + e108419 commit a545bfd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 5 15:36:54 UTC 2020 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Enable the "Search Online" menu entry for those systems that
are registered or that can be registered (jsc#SLE-9109).
- 4.2.49

-------------------------------------------------------------------
Tue Feb 4 14:09:29 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

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.48
Version: 4.2.49
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand Down
16 changes: 8 additions & 8 deletions src/clients/sw_single.rb
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def GetPackagerOptions
end
end
repo_management = Mode.normal if repo_management.nil?
online_search = Mode.normal && registered?
online_search = Mode.normal && online_search_available?

ret = {
"mode" => mode, "enable_repo_mgr" => repo_management,
Expand Down Expand Up @@ -804,14 +804,14 @@ def StartSWSingle

private

# Determines whether the running system is registered or not
# Determines whether the online search can be used in the running system
#
# @return [Booolean] true if the system is registered; false otherwise
def registered?
require "registration/registration"
::Registration::Registration.is_registered?
rescue LoadError
false
# @note The online search feature is available in those systems that
# can be installed. For the time being, we rely on the online_search
# client being available (from `yast2-registration`).
# @return [Boolean]
def online_search_available?
Yast::WFM.ClientExists("online_search")
end
end
end
Expand Down

0 comments on commit a545bfd

Please sign in to comment.