Skip to content

Commit

Permalink
Merge pull request #139 from yast/fix/ntp-client-return-value-sle-15-sp1
Browse files Browse the repository at this point in the history
Fix "ntp-client" return value for SLE 15 SP1
  • Loading branch information
imobachgs committed Jul 5, 2019
2 parents 9b9c6ab + 713ad6c commit 384cd34
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
12 changes: 12 additions & 0 deletions package/yast2-ntp-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu Jul 4 10:29:27 UTC 2019 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Fix 'ntp-client' behaviour when running in firstboot
(bsc#1140199).
- 4.1.9

-------------------------------------------------------------------
Fri Mar 8 14:39:23 UTC 2019 - knut.anderssen@suse.com

- Added cwm/popup dependency (bsc#893065, bsc#1039985)

-------------------------------------------------------------------
Tue Mar 19 16:33:52 UTC 2019 - ancor@suse.com

Expand Down
8 changes: 5 additions & 3 deletions package/yast2-ntp-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ntp-client
Version: 4.1.8
Version: 4.1.9
Release: 0
Summary: YaST2 - NTP Client Configuration
License: GPL-2.0-or-later
Expand All @@ -28,7 +28,8 @@ BuildRequires: augeas-lenses
BuildRequires: autoyast2-installation
BuildRequires: perl-XML-Writer
BuildRequires: update-desktop-files
BuildRequires: yast2 >= 3.2.21
# cwm/popup
BuildRequires: yast2 >= 4.1.15
BuildRequires: yast2-country-data
BuildRequires: yast2-devtools >= 3.1.10
BuildRequires: rubygem(%rb_default_ruby_abi:cfa) >= 0.6.0
Expand All @@ -37,7 +38,8 @@ BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake)

# proper acting TargetFile when scr is switched
Requires: augeas-lenses
Requires: yast2 >= 3.2.21
# cwm/popup
Requires: yast2 >= 4.1.15
Requires: yast2-country-data
# needed for network/config agent
# Yast::Lan.dhcp_ntp_servers
Expand Down
7 changes: 6 additions & 1 deletion src/clients/ntp-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# $Id$
#
# Main file for ntp-client configuration. Uses all other files.

Yast.import "Stage"

module Yast
class NtpClientClient < Client
def main
Expand Down Expand Up @@ -43,9 +46,11 @@ def main
end

# CommandLine handler for running GUI
# @return [Boolean] true if settings were saved
# @return [Boolean,Symbol] true if settings were saved; :next, :abort or :back
# when running in 'firstboot'
def GuiHandler
ret = NtpClientSequence()
return ret if Yast::Stage.firstboot
return false if ret == :abort || ret == :back || ret.nil?
true
end
Expand Down
23 changes: 17 additions & 6 deletions src/lib/y2ntp_client/dialog/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Yast.import "Label"
Yast.import "NtpClient"
Yast.import "Stage"
Yast.import "Mode"

module Y2NtpClient
module Dialog
Expand Down Expand Up @@ -55,7 +55,8 @@ def run
end

def abort_button
Yast::Label.CancelButton
return Yast::Label.CancelButton unless installation?
nil
end

def hardware_clock_widgets
Expand All @@ -70,13 +71,23 @@ def hardware_clock_widgets
end

def back_button
# no back button
""
return "" unless installation?
nil
end

def next_button
# FIXME: it probably cannot run in initial stage, so not needed
Yast::Stage.initial ? Yast::Label.AcceptButton : Yast::Label.OKButton
return Yast::Label.OKButton unless installation?
nil
end

# Determines whether running in installation mode
#
# We do not use Stage.initial because of firstboot, which runs in 'installation' mode
# but in 'firstboot' stage.
#
# @return [Boolean] Boolean if running in installation or update mode
def installation?
Yast::Mode.installation || Yast::Mode.update
end
end
end
Expand Down

0 comments on commit 384cd34

Please sign in to comment.