Hello community, here is the log from the commit of package yast2-country for openSUSE:Factory checked in at 2020-07-03 00:44:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-country (Old) and /work/SRC/openSUSE:Factory/.yast2-country.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-country" Fri Jul 3 00:44:18 2020 rev:214 rq:818104 version:4.3.6 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes 2020-06-10 00:37:03.237178986 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-country.new.3060/yast2-country.changes 2020-07-03 00:44:21.941929127 +0200 @@ -1,0 +2,34 @@ +Wed Jul 1 11:09:54 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- avoid build dependency on yast2-network to break build loop + (bsc#1172749) +- 4.3.6 + +------------------------------------------------------------------- +Tue Jun 30 13:43:43 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- drop autotools to fix more forgotten clients (bsc#1172749) +- 4.3.5 + +------------------------------------------------------------------- +Fri Jun 26 13:00:19 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- package properly new client created in previous change + (bsc#1172749) +- 4.3.4 + +------------------------------------------------------------------- +Tue Jun 23 11:04:37 UTC 2020 - Stefan Schubert <sch...@suse.com> + +- Generating AY file: Generate only values which are not default + values (bsc#1172749). +- 4.3.3 + +------------------------------------------------------------------- +Tue Jun 23 10:04:37 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Avoid build-require of yast2-country-data subpackage + (bsc#1173253). +- 4.3.2 + +------------------------------------------------------------------- Old: ---- yast2-country-4.3.1.tar.bz2 New: ---- yast2-country-4.3.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-country.spec ++++++ --- /var/tmp/diff_new_pack.HZ21g2/_old 2020-07-03 00:44:22.517930888 +0200 +++ /var/tmp/diff_new_pack.HZ21g2/_new 2020-07-03 00:44:22.517930888 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.3.1 +Version: 4.3.6 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only @@ -26,11 +26,9 @@ Source0: %{name}-%{version}.tar.bz2 -BuildRequires: perl-XML-Writer BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 4.2.2 BuildRequires: yast2-perl-bindings -BuildRequires: yast2-testsuite # For tests BuildRequires: rubygem(%rb_default_ruby_abi:rspec) BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) @@ -40,8 +38,6 @@ BuildRequires: yast2-ruby-bindings >= 3.1.26 # Yast2::CommandLine readonly parameter BuildRequires: yast2 >= 4.2.57 -# /usr/share/YaST2/data/languages -BuildRequires: yast2-country-data Requires: timezone Requires: yast2-perl-bindings @@ -79,11 +75,13 @@ %prep %setup -q +%check +rake test:unit + %build -%yast_build %install -%yast_install +rake install DESTDIR="%{buildroot}" %ifarch s390 s390x rm -f %{buildroot}%{yast_desktopdir}/org.opensuse.yast.Keyboard.desktop @@ -107,6 +105,7 @@ %{yast_clientdir}/*.rb %dir %{yast_libdir}/y2country %{yast_libdir}/y2country/widgets +%{yast_libdir}/y2country/clients %{yast_libdir}/y2keyboard %{yast_ydatadir}/*.ycp %{yast_ydatadir}/*.json ++++++ yast2-country-4.3.1.tar.bz2 -> yast2-country-4.3.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/Makefile.cvs new/yast2-country-4.3.6/Makefile.cvs --- old/yast2-country-4.3.1/Makefile.cvs 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/Makefile.cvs 1970-01-01 01:00:00.000000000 +0100 @@ -1,23 +0,0 @@ -# -# Makefile.cvs -# - -LIB = $(shell y2tool get-lib) - -PREFIX = /usr - -configure: all - ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB) - -all: - y2tool y2autoconf - y2tool y2automake - autoreconf --force --install - -install: configure - make - make install - -reconf: all - ./config.status --recheck - ./config.status diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/SUBDIRS new/yast2-country-4.3.6/SUBDIRS --- old/yast2-country-4.3.1/SUBDIRS 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/SUBDIRS 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -language console keyboard timezone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/configure.in.in new/yast2-country-4.3.6/configure.in.in --- old/yast2-country-4.3.1/configure.in.in 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/configure.in.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -## YCP module configure.in.in - -## Initialize -@YAST2-INIT-COMMON@ -@YAST2-INIT-YCP@ - -## some common checks -@YAST2-CHECKS-COMMON@ -@YAST2-CHECKS-YCP@ - -## and generate the output... -@YAST2-OUTPUT@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/console/Makefile.am new/yast2-country-4.3.6/console/Makefile.am --- old/yast2-country-4.3.1/console/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/console/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -# -# Makefile.am for country/console -SUBDIRS = src test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/console/src/Makefile.am new/yast2-country-4.3.6/console/src/Makefile.am --- old/yast2-country-4.3.1/console/src/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/console/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -# Sources for country - -module_DATA = \ - modules/Console.rb - -scrconf_DATA = \ - scrconf/sysconfig_console.scr \ - scrconf/etc_vconsole_conf.scr - -ydata_DATA = \ - data/consolefonts.json - -EXTRA_DIST = $(module_DATA) $(scrconf_DATA) $(ydata_DATA) - -include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/console/test/Makefile.am new/yast2-country-4.3.6/console/test/Makefile.am --- old/yast2-country-4.3.1/console/test/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/console/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -# -# Makefile.am for console/test -# - -TESTS = \ - console_test.rb - -TEST_EXTENSIONS = .rb -RB_LOG_COMPILER = rspec -VERBOSE = 1 -EXTRA_DIST = $(TESTS) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/Makefile.am new/yast2-country-4.3.6/keyboard/Makefile.am --- old/yast2-country-4.3.1/keyboard/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -# -# Makefile.am for country/keyboard -SUBDIRS = src diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/src/Makefile.am new/yast2-country-4.3.6/keyboard/src/Makefile.am --- old/yast2-country-4.3.1/keyboard/src/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,58 +0,0 @@ -# Sources for country - -module_DATA = \ - modules/Keyboard.rb - -client_DATA = \ - clients/keyboard_auto.rb \ - clients/keyboard_proposal.rb \ - clients/keyboard.rb - -schemafilesdir = $(schemadir)/autoyast/rnc -schemafiles_DATA = \ - autoyast-rnc/keyboard.rnc - -ydata_DATA = \ - data/keyboards.rb - -desktop_DATA = \ - desktop/org.opensuse.yast.Keyboard.desktop - -ywidgetsdir = @ylibdir@/y2country/widgets -ywidgets_DATA = \ - lib/y2country/widgets/keyboard_selection.rb - -ylibdir = @ylibdir@/y2keyboard -ylib_DATA = \ - lib/y2keyboard/keyboard_layout_loader.rb \ - lib/y2keyboard/keyboard_layout.rb - -ylibclientsdir = @ylibdir@/y2keyboard/clients -ylibclients_DATA = \ - lib/y2keyboard/clients/keyboard.rb \ - lib/y2keyboard/clients/keyboard_proposal.rb \ - lib/y2keyboard/clients/keyboard_auto.rb - -ylibdialogsdir = @ylibdir@/y2keyboard/dialogs -ylibdialogs_DATA = \ - lib/y2keyboard/dialogs/layout_selector.rb - -ylibstrategiesdir = @ylibdir@/y2keyboard/strategies -ylibstrategies_DATA = \ - lib/y2keyboard/strategies/systemd_strategy.rb \ - lib/y2keyboard/strategies/kb_strategy.rb \ - lib/y2keyboard/strategies/yast_proposal_strategy.rb - -symbolicdir = @icondir@/hicolor/symbolic/apps -symbolic_DATA = \ - icons/hicolor/symbolic/apps/yast-keyboard-symbolic.svg -scalabledir = @icondir@/hicolor/scalable/apps -scalable_DATA = \ - icons/hicolor/scalable/apps/yast-keyboard.svg - -EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(scrconf_DATA) \ - $(schemafiles_DATA) $(ydata_DATA) $(desktop_DATA) $(ywidgets_DATA) \ - $(ylib_DATA) $(ylibclients_DATA) $(ylibdialogs_DATA) $(ylibstrategies_DATA) \ - $(symbolic_DATA) $(scalable_DATA) - -include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/src/lib/y2keyboard/clients/keyboard_auto.rb new/yast2-country-4.3.6/keyboard/src/lib/y2keyboard/clients/keyboard_auto.rb --- old/yast2-country-4.3.1/keyboard/src/lib/y2keyboard/clients/keyboard_auto.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/src/lib/y2keyboard/clients/keyboard_auto.rb 2020-07-01 14:11:33.000000000 +0200 @@ -5,9 +5,13 @@ Yast.import "AutoInstall" Yast.import "Wizard" Yast.import "Arch" +Yast.import "Mode" +Yast.import "Language" module Keyboard class AutoClient < ::Installation::AutoClient + + include Yast::Logger def change ret = true @@ -51,5 +55,9 @@ def modified Keyboard.SetModified end + + def packages + {} + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/src/lib/y2keyboard/strategies/kb_strategy.rb new/yast2-country-4.3.6/keyboard/src/lib/y2keyboard/strategies/kb_strategy.rb --- old/yast2-country-4.3.1/keyboard/src/lib/y2keyboard/strategies/kb_strategy.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/src/lib/y2keyboard/strategies/kb_strategy.rb 2020-07-01 14:11:33.000000000 +0200 @@ -72,9 +72,9 @@ private - # set x11 keys on the fly. - # @param keyboard_code [String] the keyboard to set. - def set_x11_layout(keyboard_code) + # set x11 keys on the fly. + # @param keyboard_code [String] the keyboard to set. + def set_x11_layout(keyboard_code) x11data = get_x11_data(keyboard_code) return if x11data.empty? @@ -122,7 +122,6 @@ # hotplugged during the installation process # # @param [Hash] X11 settings - def write_udev_rule(x11data) # Remove the file if present (needed to make udev aware of changes) File.delete(UDEV_FILE) if File.file?(UDEV_FILE) @@ -140,7 +139,6 @@ Yast::SCR.Write(Yast::path(".target.string"), UDEV_FILE, nil) end end - end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/src/modules/Keyboard.rb new/yast2-country-4.3.6/keyboard/src/modules/Keyboard.rb --- old/yast2-country-4.3.1/keyboard/src/modules/Keyboard.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/src/modules/Keyboard.rb 2020-07-01 14:11:33.000000000 +0200 @@ -304,7 +304,15 @@ # AutoYaST interface function: Return the Keyboard configuration as a map. # @return [Hash] with the settings def Export - ret = { "keymap" => @curr_kbd } + ret = {} + + if @curr_kbd == Keyboard.GetKeyboardForLanguage(Language.language, + "english-us") + log.info("keymap #{@curr_kbd} is the default of language "\ + "#{Language.language} --> no export") + else + ret["keymap"] = @curr_kbd + end deep_copy(ret) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/test/keyboard_auto_test.rb new/yast2-country-4.3.6/keyboard/test/keyboard_auto_test.rb --- old/yast2-country-4.3.1/keyboard/test/keyboard_auto_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.3.6/keyboard/test/keyboard_auto_test.rb 2020-07-01 14:11:33.000000000 +0200 @@ -0,0 +1,118 @@ +#!/usr/bin/env rspec + +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" +require "y2keyboard/clients/keyboard_auto" + +describe Keyboard::AutoClient do + subject(:client) { Keyboard::AutoClient.new } + + describe "#change" do + before do + allow(Yast::WFM).to receive(:CallFunction).with( + "keyboard") + .and_return(true) + end + + it "runs keyboard client" do + expect(Yast::WFM).to receive(:CallFunction).with( + "keyboard") + client.change + end + + it "returns the value from the keyboard client" do + expect(client.change).to eq(true) + end + end + + describe "#summary" do + before do + allow(Yast::Keyboard).to receive(:Summary) + .and_return("Keyboard") + end + + it "returns the AutoYaST summary" do + expect(client.summary).to eq("Keyboard") + end + end + + describe "#import" do + let(:profile) {{ "keymap" => "english-us" }} + + it "imports the profile" do + expect(Yast::Keyboard).to receive(:Import).with(profile) + client.import(profile) + end + end + + describe "#export" do + it "exports the profile" do + expect(Yast::Keyboard).to receive(:Export) + client.export + end + end + + describe "#read" do + it "reads keyboard information" do + expect(Yast::Keyboard).to receive(:Read) + client.read + end + end + + describe "#write" do + it "writes keyboard information" do + expect(Yast::Keyboard).to receive(:Save) + client.write + end + + it "returns the value from the finish client" do + expect(Yast::Keyboard).to receive(:Save).and_return(nil) + expect(client.write).to eq(nil) + end + end + + describe "#reset" do + it "resets the keyboard setting" do + expect(Yast::Keyboard).to receive(:Import) + client.reset + end + end + + describe "#packages" do + it "returns an empty hash (no packages to install)" do + expect(client.packages).to eq({}) + end + end + + describe "#modified?" do + it "keyboard settings are modified ?" do + expect(Yast::Keyboard).to receive(:Modified) + client.modified? + end + end + + describe "#modified" do + it "set to modified" do + client.modified + expect(client.modified?).to eq(true) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/keyboard/test/keyboard_spec.rb new/yast2-country-4.3.6/keyboard/test/keyboard_spec.rb --- old/yast2-country-4.3.1/keyboard/test/keyboard_spec.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/keyboard/test/keyboard_spec.rb 2020-07-01 14:11:33.000000000 +0200 @@ -197,6 +197,36 @@ end end + describe "#Export" do + let(:profile) {{ "keymap" => "english-us" }} + + before do + subject.Set("english-us") + end + + context "keyboard settings are default values, depending on language" do + before do + allow(subject).to receive(:GetKeyboardForLanguage). + and_return("english-us") + end + + it "exports an empty hash for the AutoYaST profile" do + expect(subject.Export).to eq({}) + end + end + + context "keyboard settings are not default values" do + before do + allow(subject).to receive(:GetKeyboardForLanguage). + and_return("german") + end + + it "exports keyboard information for the AutoYaST profile" do + expect(subject.Export).to eq(profile) + end + end + end + describe "#Import" do before do allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/Makefile.am new/yast2-country-4.3.6/language/Makefile.am --- old/yast2-country-4.3.1/language/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -# -# Makefile.am for country/language -SUBDIRS = src test - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/src/Makefile.am new/yast2-country-4.3.6/language/src/Makefile.am --- old/yast2-country-4.3.1/language/src/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,109 +0,0 @@ -# Sources for country - -module_DATA = \ - modules/Language.rb - -module1dir = @moduledir@/YaPI -module1_DATA = \ - modules/YaPI/LANGUAGE.pm - -client_DATA = \ - clients/country_simple_proposal.rb \ - clients/inst_language.rb \ - clients/language.rb \ - clients/language_auto.rb \ - clients/language_proposal.rb \ - clients/language_simple_proposal.rb \ - clients/select_language.rb - -scrconf_DATA = \ - scrconf/sysconfig_language.scr - -schemafilesdir = $(schemadir)/autoyast/rnc -schemafiles_DATA = \ - autoyast-rnc/language.rnc - -ydatadir = @ydatadir@/languages -ydata_DATA = \ - data/languages/language_af_ZA.ycp \ - data/languages/language_ar_EG.ycp \ - data/languages/language_ast_ES.ycp \ - data/languages/language_bg_BG.ycp \ - data/languages/language_bn_BD.ycp \ - data/languages/language_bs_BA.ycp \ - data/languages/language_ca_ES.ycp \ - data/languages/language_cs_CZ.ycp \ - data/languages/language_cy_GB.ycp \ - data/languages/language_da_DK.ycp \ - data/languages/language_de_DE.ycp \ - data/languages/language_el_GR.ycp \ - data/languages/language_en_GB.ycp \ - data/languages/language_en_US.ycp \ - data/languages/language_es_ES.ycp \ - data/languages/language_et_EE.ycp \ - data/languages/language_fa_IR.ycp \ - data/languages/language_fi_FI.ycp \ - data/languages/language_fr_FR.ycp \ - data/languages/language_gl_ES.ycp \ - data/languages/language_gu_IN.ycp \ - data/languages/language_he_IL.ycp \ - data/languages/language_hi_IN.ycp \ - data/languages/language_hr_HR.ycp \ - data/languages/language_hu_HU.ycp \ - data/languages/language_id_ID.ycp \ - data/languages/language_it_IT.ycp \ - data/languages/language_ja_JP.ycp \ - data/languages/language_ka_GE.ycp \ - data/languages/language_km_KH.ycp \ - data/languages/language_ko_KR.ycp \ - data/languages/language_lt_LT.ycp \ - data/languages/language_mk_MK.ycp \ - data/languages/language_mr_IN.ycp \ - data/languages/language_nb_NO.ycp \ - data/languages/language_nl_NL.ycp \ - data/languages/language_nn_NO.ycp \ - data/languages/language_pa_IN.ycp \ - data/languages/language_pl_PL.ycp \ - data/languages/language_pt_BR.ycp \ - data/languages/language_pt_PT.ycp \ - data/languages/language_ro_RO.ycp \ - data/languages/language_ru_RU.ycp \ - data/languages/language_si_LK.ycp \ - data/languages/language_sk_SK.ycp \ - data/languages/language_sl_SI.ycp \ - data/languages/language_sr_RS.ycp \ - data/languages/language_sv_SE.ycp \ - data/languages/language_ta_IN.ycp \ - data/languages/language_tg_TJ.ycp \ - data/languages/language_th_TH.ycp \ - data/languages/language_tr_TR.ycp \ - data/languages/language_uk_UA.ycp \ - data/languages/language_vi_VN.ycp \ - data/languages/language_wa_BE.ycp \ - data/languages/language_xh_ZA.ycp \ - data/languages/language_zh_CN.ycp \ - data/languages/language_zh_TW.ycp \ - data/languages/language_zu_ZA.ycp \ - data/languages/languages.ycp - -ylibdir = @ylibdir@/y2country -ylib_DATA = \ - lib/y2country/language_dbus.rb - -ywidgetsdir = @ylibdir@/y2country/widgets -ywidgets_DATA = \ - lib/y2country/widgets/language_selection.rb - -desktop_DATA = \ - desktop/org.opensuse.yast.Language.desktop - -symbolicdir = @icondir@/hicolor/symbolic/apps -symbolic_DATA = \ - icons/hicolor/symbolic/apps/yast-language-symbolic.svg -scalabledir = @icondir@/hicolor/scalable/apps -scalable_DATA = \ - icons/hicolor/scalable/apps/yast-language.svg - -EXTRA_DIST = $(module_DATA) $(module1_DATA) $(client_DATA) $(scrconf_DATA) $(schemafiles_DATA) $(ydata_DATA) $(desktop_DATA) $(ylib_DATA) $(ywidgets_DATA) $(symbolic_DATA) $(scalable_DATA) - -include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/src/clients/language_auto.rb new/yast2-country-4.3.6/language/src/clients/language_auto.rb --- old/yast2-country-4.3.1/language/src/clients/language_auto.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/src/clients/language_auto.rb 2020-07-01 14:11:33.000000000 +0200 @@ -1,104 +1,2 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# Autoinstallation client for language setting -# Author : Jiri Suchomel <jsuch...@suse.cz> -# -# $Id$ -module Yast - class LanguageAutoClient < Client - def main - Yast.import "Language" - Yast.import "Console" - Yast.import "Wizard" - - @ret = nil - @func = "" - @param = {} - - if Ops.greater_than(Builtins.size(WFM.Args), 0) && - Ops.is_string?(WFM.Args(0)) - @func = Convert.to_string(WFM.Args(0)) - if Ops.greater_than(Builtins.size(WFM.Args), 1) && - Ops.is_map?(WFM.Args(1)) - @param = Convert.convert( - WFM.Args(1), - :from => "any", - :to => "map <string, any>" - ) - end - end - - Builtins.y2debug("func=%1", @func) - Builtins.y2debug("param=%1", @param) - - if @func == "Change" - Wizard.CreateDialog - Wizard.HideAbortButton - - @ret = WFM.CallFunction( - "select_language", - [{ "enable_back" => true, "enable_next" => true }] - ) - - Wizard.CloseDialog - elsif @func == "Import" - @ret = Language.Import(@param) - elsif @func == "Summary" - @ret = Language.Summary - elsif @func == "Reset" - Language.Import( - { - "language" => Language.language_on_entry, - "languages" => Language.languages_on_entry - } - ) - Language.ExpertSettingsChanged = false - @ret = {} - elsif @func == "Read" - @ret = Language.Read(true) - elsif @func == "Export" - @ret = Language.Export - elsif @func == "Write" - Console.SelectFont(Language.language) - Console.Save - @ret = Language.Save - # Return if configuration was changed - # return boolean - elsif @func == "GetModified" - @ret = Language.Modified - # Set all modified flags - # return boolean - elsif @func == "SetModified" - Language.ExpertSettingsChanged = true # hook (no general 'modified' variable) - @ret = true - end - - Builtins.y2debug("ret=%1", @ret) - Builtins.y2milestone("language auto finished") - Builtins.y2milestone("----------------------------------------") - - deep_copy(@ret) - end - end -end - -Yast::LanguageAutoClient.new.main +require "y2country/clients/language_auto" +::Language::AutoClient.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/src/lib/y2country/clients/language_auto.rb new/yast2-country-4.3.6/language/src/lib/y2country/clients/language_auto.rb --- old/yast2-country-4.3.1/language/src/lib/y2country/clients/language_auto.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.3.6/language/src/lib/y2country/clients/language_auto.rb 2020-07-01 14:11:33.000000000 +0200 @@ -0,0 +1,72 @@ +require "yast" +require "installation/auto_client" + +Yast.import "Language" +Yast.import "Console" +Yast.import "AutoInstall" +Yast.import "Wizard" +Yast.import "Mode" + +module Language + class AutoClient < ::Installation::AutoClient + + include Yast::Logger + + def change + Wizard.CreateDialog + Wizard.HideAbortButton + + ret = WFM.CallFunction( + "select_language", + [{ "enable_back" => true, "enable_next" => true }] + ) + Wizard.CloseDialog + ret + end + + def import(data) + Language.Import(data) + end + + def summary + Language.Summary + end + + def reset + Language.Import( + { + "language" => Language.language_on_entry, + "languages" => Language.languages_on_entry + } + ) + Language.ExpertSettingsChanged = false + {} + end + + def read + Language.Read(true) + end + + def export + Language.Export + end + + def write + Console.SelectFont(Language.language) + Console.Save + Language.Save + end + + def modified? + Language.Modified + end + + def packages + {} + end + + def modified + Language.ExpertSettingsChanged = true # hook (no general 'modified' variable) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/src/modules/Language.rb new/yast2-country-4.3.6/language/src/modules/Language.rb --- old/yast2-country-4.3.1/language/src/modules/Language.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/src/modules/Language.rb 2020-07-01 14:11:33.000000000 +0200 @@ -1108,6 +1108,12 @@ true end + # Initial language + # @return default language + def default_language + DEFAULT_FALLBACK_LANGUAGE + end + # AutoYaST interface function: Get the Language configuration from a map. # @param [Hash] settings imported map # @return success @@ -1137,8 +1143,21 @@ # AutoYaST interface function: Return the Language configuration as a map. # @return [Hash] with the settings def Export - ret = { "language" => @language, "languages" => @languages } - Ops.set(ret, "use_utf8", @use_utf8) if !@use_utf8 + ret = {} + if @language == default_language + log.info("language <#{@language}> is the default language "\ + "--> no export") + else + ret["language"] = @language + end + + if @languages.empty? + log.info("empty languages --> no export") + else + ret["languages"] = @languages + end + + ret["use_utf8"] = @use_utf8 if !@use_utf8 deep_copy(ret) end @@ -1341,6 +1360,7 @@ publish :variable => :selection_skipped, :type => "boolean" publish :variable => :available_lang_filenames, :type => "list <string>" publish :function => :RemoveSuffix, :type => "string (string)" + publish :function => :default_language, :type => "string ()" publish :function => :CJKLanguage, :type => "boolean (string)" publish :function => :GetTextMode, :type => "boolean ()" publish :function => :GetLanguagesMap, :type => "map <string, list> (boolean)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/test/Language_test.rb new/yast2-country-4.3.6/language/test/Language_test.rb --- old/yast2-country-4.3.1/language/test/Language_test.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/test/Language_test.rb 2020-07-01 14:11:33.000000000 +0200 @@ -471,6 +471,18 @@ subject.SetExpertValues("use_utf8" => false) expect(subject.Export).to include("use_utf8" => false) end + + context "language settings are default values" do + before do + subject.language = subject.default_language + subject.languages = [] + subject.SetExpertValues("use_utf8" => true) + end + + it "exports an empty hash for the AutoYaST profile" do + expect(subject.Export).to eq({}) + end + end end describe "#Import" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/test/Makefile.am new/yast2-country-4.3.6/language/test/Makefile.am --- old/yast2-country-4.3.1/language/test/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/language/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -# -# Makefile.am for language/test -# - -TESTS = \ - Language_test.rb \ - widgets/language_selection_test.rb - -TEST_EXTENSIONS = .rb -RB_LOG_COMPILER = rspec --format doc -VERBOSE = 1 -EXTRA_DIST = $(TESTS) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/language/test/language_auto_test.rb new/yast2-country-4.3.6/language/test/language_auto_test.rb --- old/yast2-country-4.3.1/language/test/language_auto_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.3.6/language/test/language_auto_test.rb 2020-07-01 14:11:33.000000000 +0200 @@ -0,0 +1,127 @@ +#!/usr/bin/env rspec + +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" +require "y2country/clients/language_auto" + +describe Language::AutoClient do + subject(:client) { Language::AutoClient.new } + + describe "#change" do + before do + allow(Yast::WFM).to receive(:CallFunction).with( + "select_language", [{"enable_back"=>true, "enable_next"=>true}]) + .and_return(true) + end + + it "runs select_language client" do + expect(Yast::WFM).to receive(:CallFunction).with( + "select_language", [{"enable_back"=>true, "enable_next"=>true}]) + client.change + end + + it "returns the value from the select_language client" do + expect(client.change).to eq(true) + end + end + + describe "#summary" do + before do + allow(Yast::Language).to receive(:Summary) + .and_return("Services List") + end + + it "returns the AutoYaST summary" do + expect(client.summary).to eq("Services List") + end + end + + describe "#import" do + let(:profile) { + { + "language" => "en_US", + "languages" => "fr_FR,en_US," + } + } + + it "imports the profile" do + expect(Yast::Language).to receive(:Import).with(profile) + client.import(profile) + end + end + + describe "#export" do + it "exports the profile" do + expect(Yast::Language).to receive(:Export) + client.export() + end + end + + describe "#read" do + it "reads language information" do + expect(Yast::Language).to receive(:Read) + client.read + end + end + + describe "#write" do + it "writes language information" do + expect(Yast::Language).to receive(:Save) + # setting console + expect(Yast::Console).to receive(:SelectFont) + expect(Yast::Console).to receive(:Save) + client.write + end + + it "returns the value from the finish client" do + expect(Yast::Language).to receive(:Save).and_return(true) + expect(client.write).to eq(true) + end + end + + describe "#reset" do + it "resets the language setting" do + expect(Yast::Language).to receive(:Import) + client.reset + expect(Yast::Language.ExpertSettingsChanged).to eq(false) + end + end + + describe "#packages" do + it "returns an empty hash (no packages to install)" do + expect(client.packages).to eq({}) + end + end + + describe "#modified?" do + it "language information is modified ?" do + expect(Yast::Language).to receive(:Modified) + client.modified? + end + end + + describe "#modified" do + it "set to modified" do + client.modified + expect(client.modified?).to eq(true) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/package/yast2-country.changes new/yast2-country-4.3.6/package/yast2-country.changes --- old/yast2-country-4.3.1/package/yast2-country.changes 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/package/yast2-country.changes 2020-07-01 14:11:33.000000000 +0200 @@ -1,4 +1,38 @@ ------------------------------------------------------------------- +Wed Jul 1 11:09:54 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- avoid build dependency on yast2-network to break build loop + (bsc#1172749) +- 4.3.6 + +------------------------------------------------------------------- +Tue Jun 30 13:43:43 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- drop autotools to fix more forgotten clients (bsc#1172749) +- 4.3.5 + +------------------------------------------------------------------- +Fri Jun 26 13:00:19 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- package properly new client created in previous change + (bsc#1172749) +- 4.3.4 + +------------------------------------------------------------------- +Tue Jun 23 11:04:37 UTC 2020 - Stefan Schubert <sch...@suse.com> + +- Generating AY file: Generate only values which are not default + values (bsc#1172749). +- 4.3.3 + +------------------------------------------------------------------- +Tue Jun 23 10:04:37 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Avoid build-require of yast2-country-data subpackage + (bsc#1173253). +- 4.3.2 + +------------------------------------------------------------------- Mon Jun 1 07:11:31 UTC 2020 - Michal Filka <mfi...@suse.com> - bnc#1172180 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/package/yast2-country.spec new/yast2-country-4.3.6/package/yast2-country.spec --- old/yast2-country-4.3.1/package/yast2-country.spec 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/package/yast2-country.spec 2020-07-01 14:11:33.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.3.1 +Version: 4.3.6 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only @@ -26,11 +26,9 @@ Source0: %{name}-%{version}.tar.bz2 -BuildRequires: perl-XML-Writer BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 4.2.2 BuildRequires: yast2-perl-bindings -BuildRequires: yast2-testsuite # For tests BuildRequires: rubygem(%rb_default_ruby_abi:rspec) BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) @@ -40,8 +38,6 @@ BuildRequires: yast2-ruby-bindings >= 3.1.26 # Yast2::CommandLine readonly parameter BuildRequires: yast2 >= 4.2.57 -# /usr/share/YaST2/data/languages -BuildRequires: yast2-country-data Requires: timezone Requires: yast2-perl-bindings @@ -79,11 +75,13 @@ %prep %setup -q +%check +rake test:unit + %build -%yast_build %install -%yast_install +rake install DESTDIR="%{buildroot}" %ifarch s390 s390x rm -f %{buildroot}%{yast_desktopdir}/org.opensuse.yast.Keyboard.desktop @@ -107,6 +105,7 @@ %{yast_clientdir}/*.rb %dir %{yast_libdir}/y2country %{yast_libdir}/y2country/widgets +%{yast_libdir}/y2country/clients %{yast_libdir}/y2keyboard %{yast_ydatadir}/*.ycp %{yast_ydatadir}/*.json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/test/test_helper.rb new/yast2-country-4.3.6/test/test_helper.rb --- old/yast2-country-4.3.1/test/test_helper.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/test/test_helper.rb 2020-07-01 14:11:33.000000000 +0200 @@ -28,3 +28,11 @@ ] end end + +# stub module to prevent its Import +# Useful for modules from different yast packages, to avoid build dependencies +def stub_module(name) + Yast.const_set name.to_sym, Class.new { def self.fake_method; end } +end + +stub_module("AutoInstall") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/Makefile.am new/yast2-country-4.3.6/timezone/Makefile.am --- old/yast2-country-4.3.1/timezone/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -# -# Makefile.am for country/timezone -SUBDIRS = src test - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/src/Makefile.am new/yast2-country-4.3.6/timezone/src/Makefile.am --- old/yast2-country-4.3.1/timezone/src/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -# Sources for country - -module_DATA = \ - modules/Timezone.rb - -module1dir = @moduledir@/YaPI -module1_DATA = \ - modules/YaPI/TIME.pm - -client_DATA = \ - clients/inst_timezone.rb \ - clients/timezone_auto.rb \ - clients/timezone.rb \ - clients/timezone_proposal.rb - -yncludedir = @yncludedir@/timezone -ynclude_DATA = \ - include/timezone/dialogs.rb - -scrconf_DATA = \ - scrconf/sysconfig_clock.scr \ - scrconf/etc_adjtime.scr - -schemafilesdir = $(schemadir)/autoyast/rnc -schemafiles_DATA = \ - autoyast-rnc/timezone.rnc - -ydata_DATA = \ - data/lang2tz.ycp \ - data/timezone_raw.ycp - -desktop_DATA = \ - desktop/org.opensuse.yast.Timezone.desktop - -symbolicdir = @icondir@/hicolor/symbolic/apps -symbolic_DATA = \ - icons/hicolor/symbolic/apps/yast-timezone-symbolic.svg -scalabledir = @icondir@/hicolor/scalable/apps -scalable_DATA = \ - icons/hicolor/scalable/apps/yast-timezone.svg - -EXTRA_DIST = $(module_DATA) $(module1_DATA) $(client_DATA) $(ynclude_DATA) $(scrconf_DATA) $(schemafiles_DATA) $(ydata_DATA) $(desktop_DATA) $(symbolic_DATA) $(scalable_DATA) - -include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/src/clients/timezone_auto.rb new/yast2-country-4.3.6/timezone/src/clients/timezone_auto.rb --- old/yast2-country-4.3.1/timezone/src/clients/timezone_auto.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/src/clients/timezone_auto.rb 2020-07-01 14:11:33.000000000 +0200 @@ -1,95 +1,2 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ -# Autoinstallation client for timezone setting -# Author : Jiri Suchomel <jsuch...@suse.cz> -# -# $Id$ -module Yast - class TimezoneAutoClient < Client - def main - Yast.import "UI" - Yast.import "Mode" - Yast.import "Timezone" - - Yast.include self, "timezone/dialogs.rb" - - @ret = nil - @func = "" - @param = {} - - if Ops.greater_than(Builtins.size(WFM.Args), 0) && - Ops.is_string?(WFM.Args(0)) - @func = Convert.to_string(WFM.Args(0)) - if Ops.greater_than(Builtins.size(WFM.Args), 1) && - Ops.is_map?(WFM.Args(1)) - @param = Convert.convert( - WFM.Args(1), - :from => "any", - :to => "map <string, any>" - ) - end - end - - Builtins.y2debug("func=%1", @func) - Builtins.y2debug("param=%1", @param) - - if @func == "Change" - Wizard.CreateDialog - Wizard.HideAbortButton - - @ret = TimezoneDialog({ "enable_back" => true, "enable_next" => true }) - - Wizard.CloseDialog - elsif @func == "Import" - @ret = Timezone.Import(@param) - elsif @func == "Summary" - @ret = Timezone.Summary - elsif @func == "Reset" - Timezone.PopVal - Timezone.modified = false - @ret = {} - elsif @func == "Read" - @ret = Timezone.Read - elsif @func == "Export" - @ret = Timezone.Export - elsif @func == "Write" - @ret = Timezone.Save - # Return if configuration was changed - # return boolean - elsif @func == "GetModified" - @ret = Timezone.Modified - # Set all modified flags - # return boolean - elsif @func == "SetModified" - Timezone.modified = true - @ret = true - end - - Builtins.y2debug("ret=%1", @ret) - Builtins.y2milestone("timezone auto finished") - Builtins.y2milestone("----------------------------------------") - - deep_copy(@ret) - end - end -end - -Yast::TimezoneAutoClient.new.main +require "y2country/clients/timezone_auto" +::Yast::TimezoneAutoClient.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/src/include/timezone/dialogs.rb new/yast2-country-4.3.6/timezone/src/include/timezone/dialogs.rb --- old/yast2-country-4.3.1/timezone/src/include/timezone/dialogs.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/src/include/timezone/dialogs.rb 2020-07-01 14:11:33.000000000 +0200 @@ -33,8 +33,6 @@ # # $Id$ -require "y2network/ntp_server" - module Yast module TimezoneDialogsInclude def initialize_timezone_dialogs(include_target) @@ -183,8 +181,6 @@ def SetTimeDialog ntp_help_text = Convert.to_string(ntp_call("ui_help_text", {})) - textmode = Language.GetTextMode - # help text for set time dialog htext = Ops.add( _( @@ -577,6 +573,7 @@ @ntp_used = true # configure NTP client # to prevent misusage of ntp.org we need to distinguish opensuse and SLE usage + require "y2network/ntp_server" servers = Y2Network::NtpServer.default_servers.map(&:hostname) @ntp_server = servers.sample # Dot not select a dhcp ntp server by default but add it to the offered @@ -716,7 +713,6 @@ timezoneterm ) # cache for lists with timezone items - timezones_for_region = {} get_timezones_for_region = lambda do |region, zone| if !Builtins.haskey(sorted_zonemap, region) reg_list = Builtins.maplist( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/src/lib/y2country/clients/timezone_auto.rb new/yast2-country-4.3.6/timezone/src/lib/y2country/clients/timezone_auto.rb --- old/yast2-country-4.3.1/timezone/src/lib/y2country/clients/timezone_auto.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.3.6/timezone/src/lib/y2country/clients/timezone_auto.rb 2020-07-01 14:11:33.000000000 +0200 @@ -0,0 +1,63 @@ +require "yast" +require "installation/auto_client" + +Yast.import "Mode" +Yast.import "Timezone" +Yast.import "UI" +Yast.import "AutoInstall" +Yast.import "Wizard" + +module Yast + class TimezoneAutoClient < ::Installation::AutoClient + + include Yast::Logger + + def change + Yast.include self, "timezone/dialogs.rb" + + Wizard.CreateDialog + Wizard.HideAbortButton + ret = TimezoneDialog({ "enable_back" => true, "enable_next" => true }) + Wizard.CloseDialog + ret + end + + def import(data) + Timezone.Import(data) + end + + def summary + Timezone.Summary + end + + def reset + Timezone.PopVal + Timezone.modified = false + {} + end + + def read + Timezone.Read + end + + def export + Timezone.Export + end + + def write + Timezone.Save + end + + def modified? + Timezone.Modified + end + + def packages + {} + end + + def modified + Timezone.modified = true + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/src/modules/Timezone.rb new/yast2-country-4.3.6/timezone/src/modules/Timezone.rb --- old/yast2-country-4.3.1/timezone/src/modules/Timezone.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/src/modules/Timezone.rb 2020-07-01 14:11:33.000000000 +0200 @@ -1001,10 +1001,27 @@ # AutoYaST interface function: Return the Timezone configuration as a map. # @return [Hash] with the settings def Export - ret = { - "timezone" => @timezone, - "hwclock" => @hwclock == "-u" ? "UTC" : "localtime" - } + ret = {} + + if(ProposeLocaltime() && @hwclock != "-u") || + (!ProposeLocaltime() && @hwclock == "-u") + log.info("hwclock <#{@hwclock}> is the default value"\ + " --> no export") + else + ret["hwclock"] = @hwclock == "-u" ? "UTC" : "localtime" + end + + local_timezone = Timezone.GetTimezoneForLanguage( + Language.language, + "US/Eastern" + ) + if local_timezone == @timezone + log.info("timezone <#{@timezone}> is the default value"\ + " --> no export") + else + ret["timezone"] = @timezone + end + deep_copy(ret) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/test/Makefile.am new/yast2-country-4.3.6/timezone/test/Makefile.am --- old/yast2-country-4.3.1/timezone/test/Makefile.am 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -TESTS = \ - Timezone_test.rb -TEST_EXTENSIONS = .rb -RB_LOG_COMPILER = rspec -VERBOSE = 1 -EXTRA_DIST = $(TESTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/test/Timezone_test.rb new/yast2-country-4.3.6/timezone/test/Timezone_test.rb --- old/yast2-country-4.3.1/timezone/test/Timezone_test.rb 2020-06-01 09:32:53.000000000 +0200 +++ new/yast2-country-4.3.6/timezone/test/Timezone_test.rb 2020-07-01 14:11:33.000000000 +0200 @@ -1,4 +1,5 @@ #!/usr/bin/env rspec +# coding: utf-8 require_relative "test_helper" require "y2country/language_dbus" @@ -6,9 +7,7 @@ Yast.import "ProductFeatures" describe "Yast::Timezone" do - let(:readonly_timezone) { false } - let(:default_timezone) { "" } - let(:initial) { false } + subject { Yast::Timezone } before do # Do not run any command on system @@ -22,9 +21,20 @@ .with("globals", "timezone").and_return(default_timezone) allow(Yast::Stage).to receive(:initial).and_return(initial) Yast::Timezone.main + + allow(Yast::Language).to receive(:GetLang2TimezoneMap).and_return(timezones) end - subject { Yast::Timezone } + let(:readonly_timezone) { false } + let(:default_timezone) { "" } + let(:initial) { false } + + let(:timezones) do + { + "en_US" => "US/Eastern", + "cs_CZ" => "Europe/Prague" + } + end describe "#ProposeLocaltime" do subject { Yast::Timezone.ProposeLocaltime } @@ -391,6 +401,21 @@ expect(subject.Export).to include("hwclock"=> "localtime") end + + context "timezone settings are default values" do + before do + subject.hwclock = "-u" + subject.timezone = "America/New_York" + allow(subject).to receive(:ProposeLocaltime). + and_return(false) + allow(subject).to receive(:GetTimezoneForLanguage). + and_return("America/New_York") + end + + it "exports an empty hash for the AutoYaST profile" do + expect(subject.Export).to eq({}) + end + end end describe "#Summary" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.1/timezone/test/timezone_auto_test.rb new/yast2-country-4.3.6/timezone/test/timezone_auto_test.rb --- old/yast2-country-4.3.1/timezone/test/timezone_auto_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.3.6/timezone/test/timezone_auto_test.rb 2020-07-01 14:11:33.000000000 +0200 @@ -0,0 +1,129 @@ +#!/usr/bin/env rspec + +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" +require "y2country/clients/timezone_auto" + +describe Yast::TimezoneAutoClient do + subject(:client) { Yast::TimezoneAutoClient.new } + + describe "#change" do + before do + allow(Yast::Wizard).to receive(:CreateDialog) + allow(Yast::Wizard).to receive(:CloseDialog) + allow(Yast::Wizard).to receive(:HideAbortButton) + allow(subject).to receive(:TimezoneDialog).with( + {"enable_back"=>true, "enable_next"=>true}) + .and_return(true) + end + + it "runs timezone dialog" do + expect(subject).to receive(:TimezoneDialog).with( + {"enable_back"=>true, "enable_next"=>true}) + .and_return(true) + client.change + end + + it "returns the value from the timezone dialog" do + expect(client.change).to eq(true) + end + end + + describe "#summary" do + before do + allow(Yast::Timezone).to receive(:Summary) + .and_return("Timezone Summary") + end + + it "returns the AutoYaST summary" do + expect(client.summary).to eq("Timezone Summary") + end + end + + describe "#import" do + let(:profile) { + { + "hwclock" => "UTC", + "timezone" => "America/New_York" + } + } + + it "imports the profile" do + expect(Yast::Timezone).to receive(:Import).with(profile) + client.import(profile) + end + end + + + describe "#export" do + it "exports the profile" do + expect(Yast::Timezone).to receive(:Export) + client.export + end + end + + describe "#read" do + it "reads timezone information" do + expect(Yast::Timezone).to receive(:Read) + client.read + end + end + + describe "#write" do + it "writes timezone information" do + expect(Yast::Timezone).to receive(:Save) + client.write + end + + it "returns the value from the finish client" do + expect(Yast::Timezone).to receive(:Save).and_return(true) + expect(client.write).to eq(true) + end + end + + describe "#reset" do + it "resets the timezone setting" do + expect(Yast::Timezone).to receive(:PopVal) + client.reset + expect(Yast::Timezone.modified).to eq(false) + end + end + + describe "#packages" do + it "returns an empty hash (no packages to install)" do + expect(client.packages).to eq({}) + end + end + + describe "#modified?" do + it "timezone settings are modified ?" do + expect(Yast::Timezone).to receive(:Modified) + client.modified? + end + end + + describe "#modified" do + it "set to modified" do + client.modified + expect(client.modified?).to eq(true) + end + end +end