Hello community,
here is the log from the commit of package yast2-firstboot for openSUSE:Factory
checked in at 2019-05-15 12:23:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-firstboot (Old)
and /work/SRC/openSUSE:Factory/.yast2-firstboot.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-firstboot"
Wed May 15 12:23:04 2019 rev:79 rq:702830 version:4.1.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-firstboot/yast2-firstboot.changes
2019-04-12 09:12:31.413616683 +0200
+++
/work/SRC/openSUSE:Factory/.yast2-firstboot.new.5148/yast2-firstboot.changes
2019-05-15 12:23:06.074273185 +0200
@@ -1,0 +2,10 @@
+Mon May 13 11:31:56 UTC 2019 - David Diaz <[email protected]>
+
+- Update the firstboot.xml template to use the "firstboot_licenses"
+ client for the license agreement.
+- Adapt the "firstboot_licenses" client to cover all possible
+ scenarios: to display the Novell license agreement, the vendor
+ license agreement, both or simply the default one (bsc#1131327).
+- 4.1.7
+
+-------------------------------------------------------------------
Old:
----
yast2-firstboot-4.1.6.tar.bz2
New:
----
yast2-firstboot-4.1.7.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-firstboot.spec ++++++
--- /var/tmp/diff_new_pack.8rTOwB/_old 2019-05-15 12:23:06.590272057 +0200
+++ /var/tmp/diff_new_pack.8rTOwB/_new 2019-05-15 12:23:06.594272048 +0200
@@ -12,12 +12,12 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: yast2-firstboot
-Version: 4.1.6
+Version: 4.1.7
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-firstboot-4.1.6.tar.bz2 -> yast2-firstboot-4.1.7.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-firstboot-4.1.6/control/firstboot.xml
new/yast2-firstboot-4.1.7/control/firstboot.xml
--- old/yast2-firstboot-4.1.6/control/firstboot.xml 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/control/firstboot.xml 2019-05-13
16:28:37.000000000 +0200
@@ -109,7 +109,7 @@
<module>
<label>License Agreement</label>
<enabled config:type="boolean">true</enabled>
- <name>firstboot_license</name>
+ <name>firstboot_licenses</name>
</module>
<module>
<label>Host Name</label>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/package/yast2-firstboot.changes
new/yast2-firstboot-4.1.7/package/yast2-firstboot.changes
--- old/yast2-firstboot-4.1.6/package/yast2-firstboot.changes 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/package/yast2-firstboot.changes 2019-05-13
16:28:37.000000000 +0200
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Mon May 13 11:31:56 UTC 2019 - David Diaz <[email protected]>
+
+- Update the firstboot.xml template to use the "firstboot_licenses"
+ client for the license agreement.
+- Adapt the "firstboot_licenses" client to cover all possible
+ scenarios: to display the Novell license agreement, the vendor
+ license agreement, both or simply the default one (bsc#1131327).
+- 4.1.7
+
+-------------------------------------------------------------------
Thu Apr 11 09:25:14 UTC 2019 - [email protected]
- Disable duplicate license dialogs (boo#131301)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-firstboot-4.1.6/package/yast2-firstboot.spec
new/yast2-firstboot-4.1.7/package/yast2-firstboot.spec
--- old/yast2-firstboot-4.1.6/package/yast2-firstboot.spec 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/package/yast2-firstboot.spec 2019-05-13
16:28:37.000000000 +0200
@@ -16,7 +16,7 @@
#
Name: yast2-firstboot
-Version: 4.1.6
+Version: 4.1.7
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-firstboot-4.1.6/src/Makefile.am
new/yast2-firstboot-4.1.7/src/Makefile.am
--- old/yast2-firstboot-4.1.6/src/Makefile.am 2019-04-11 14:19:35.000000000
+0200
+++ new/yast2-firstboot-4.1.7/src/Makefile.am 2019-05-13 16:28:37.000000000
+0200
@@ -45,7 +45,8 @@
ylibclient_DATA = \
lib/y2firstboot/clients/configuration_management.rb \
lib/y2firstboot/clients/root.rb \
- lib/y2firstboot/clients/user.rb
+ lib/y2firstboot/clients/user.rb \
+ lib/y2firstboot/clients/licenses.rb
symbolicdir = @icondir@/hicolor/symbolic/apps
symbolic_DATA = \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/src/clients/firstboot_license.rb
new/yast2-firstboot-4.1.7/src/clients/firstboot_license.rb
--- old/yast2-firstboot-4.1.6/src/clients/firstboot_license.rb 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/src/clients/firstboot_license.rb 2019-05-15
12:23:06.702271812 +0200
@@ -1,69 +1 @@
-# 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.
-#
------------------------------------------------------------------------------
-
-# Module : Firstboot configuration
-# File : firstboot_license_novell.ycp
-# Author : Ladislav Slezak <[email protected]>,
-# Purpose : Display vendor license during firstboot configuration
-#
-# $Id$
-module Yast
- class FirstbootLicenseClient < Client
- def main
- Yast.import "UI"
- textdomain "firstboot"
-
- Yast.import "Misc"
- Yast.import "GetInstArgs"
-
-
- @result = nil
-
- @args = GetInstArgs.argmap
- Ops.set(
- @args,
- "directory",
- Misc.SysconfigRead(
- path(".sysconfig.firstboot.FIRSTBOOT_LICENSE_DIR"),
- "/etc/YaST2"
- )
- )
- Ops.set(
- @args,
- "action",
- Misc.SysconfigRead(
- path(".sysconfig.firstboot.LICENSE_REFUSAL_ACTION"),
- "abort"
- )
- )
-
- Builtins.y2milestone("inst_license options: %1", @args)
-
- @result = WFM.CallFunction("inst_license", [@args])
-
- UI.CloseDialog if @result == :halt
-
- deep_copy(@result)
- end
- end
-end
-
-Yast::FirstbootLicenseClient.new.main
+symbolic link to firstboot_licenses.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/src/clients/firstboot_license_novell.rb
new/yast2-firstboot-4.1.7/src/clients/firstboot_license_novell.rb
--- old/yast2-firstboot-4.1.6/src/clients/firstboot_license_novell.rb
2019-04-11 14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/src/clients/firstboot_license_novell.rb
2019-05-15 12:23:06.694271829 +0200
@@ -1,79 +1 @@
-# 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.
-#
------------------------------------------------------------------------------
-
-# Module : firstboot_license_novell.ycp
-# Authors: Ladislav Slezak <[email protected]>, Jiri Suchomel <[email protected]>
-# Purpose: Display Novell license at the start of firstboot
-#
-# $Id$
-module Yast
- class FirstbootLicenseNovellClient < Client
- def main
- Yast.import "UI"
- textdomain "firstboot"
-
- Yast.import "Misc"
- Yast.import "GetInstArgs"
- Yast.import "ProductFeatures"
-
- @result = nil
-
- @args = GetInstArgs.argmap
-
- # default directory with Novell license texts
- @default_dir = ProductFeatures.GetStringFeature(
- "globals",
- "base_product_license_directory"
- )
-
- Ops.set(
- @args,
- "directory",
- Misc.SysconfigRead(
- path(".sysconfig.firstboot.FIRSTBOOT_NOVELL_LICENSE_DIR"),
- @default_dir
- )
- )
- if Ops.get_string(@args, "directory", "") == ""
- Ops.set(@args, "directory", @default_dir)
- end
-
- Ops.set(
- @args,
- "action",
- Misc.SysconfigRead(
- path(".sysconfig.firstboot.LICENSE_REFUSAL_ACTION"),
- "abort"
- )
- )
-
- Builtins.y2milestone("inst_license options: %1", @args)
-
- @result = WFM.CallFunction("inst_license", [@args])
-
- UI.CloseDialog if @result == :halt
-
- deep_copy(@result)
- end
- end
-end
-
-Yast::FirstbootLicenseNovellClient.new.main
+symbolic link to firstboot_licenses.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/src/clients/firstboot_licenses.rb
new/yast2-firstboot-4.1.7/src/clients/firstboot_licenses.rb
--- old/yast2-firstboot-4.1.6/src/clients/firstboot_licenses.rb 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/src/clients/firstboot_licenses.rb 2019-05-13
16:28:37.000000000 +0200
@@ -1,81 +1,24 @@
# encoding: utf-8
-#
------------------------------------------------------------------------------
-# Copyright (c) 2012 Novell, Inc. All Rights Reserved.
+# Copyright (c) [2019] 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 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.
+# 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.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
#
-# To contact Novell about this file by physical or electronic mail, you may
find
-# current contact information at www.novell.com.
-#
------------------------------------------------------------------------------
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
-# Purpose : Display 2 license texts (probably from vendor and Novell)
during firstboot configuration
-#
-# $Id$
-module Yast
- class FirstbootLicensesClient < Client
- def main
- Yast.import "UI"
- textdomain "firstboot"
-
- Yast.import "Misc"
- Yast.import "GetInstArgs"
- Yast.import "ProductFeatures"
-
-
- @result = nil
-
- @args = GetInstArgs.argmap
-
- # default directory with Novell license texts
- @default_dir = ProductFeatures.GetStringFeature(
- "globals",
- "base_product_license_directory"
- )
-
- @dir1 = Misc.SysconfigRead(
- path(".sysconfig.firstboot.FIRSTBOOT_LICENSE_DIR"),
- "/etc/YaST2"
- )
- @dir2 = Misc.SysconfigRead(
- path(".sysconfig.firstboot.FIRSTBOOT_NOVELL_LICENSE_DIR"),
- @default_dir
- )
-
- if @dir2 != @dir1
- Ops.set(@args, "directories", [@dir1, @dir2])
- else
- Ops.set(@args, "directories", [@dir1])
- end
-
- Ops.set(
- @args,
- "action",
- Misc.SysconfigRead(
- path(".sysconfig.firstboot.LICENSE_REFUSAL_ACTION"),
- "abort"
- )
- )
-
- Builtins.y2milestone("inst_license options: %1", @args)
-
- @result = WFM.CallFunction("inst_license", [@args])
-
- UI.CloseDialog if @result == :halt
-
- deep_copy(@result)
- end
- end
-end
+require "y2firstboot/clients/licenses"
-Yast::FirstbootLicensesClient.new.main
+Y2Firstboot::Clients::Licenses.new.run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/src/lib/y2firstboot/clients/licenses.rb
new/yast2-firstboot-4.1.7/src/lib/y2firstboot/clients/licenses.rb
--- old/yast2-firstboot-4.1.6/src/lib/y2firstboot/clients/licenses.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-firstboot-4.1.7/src/lib/y2firstboot/clients/licenses.rb
2019-05-13 16:28:37.000000000 +0200
@@ -0,0 +1,87 @@
+# encoding: utf-8
+
+# Copyright (c) [2019] 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 "yast"
+
+Yast.import "UI"
+Yast.import "Misc"
+Yast.import "GetInstArgs"
+
+module Y2Firstboot
+ module Clients
+ # Client that allows to display license texts during the firstboot
+ # configuration.
+ #
+ # NOTE: for backward compatibility, it can display the Novell licenses if a
+ # valid path is given through FIRSTBOOT_NOVELL_LICENCE_DIR
+ class Licenses < Yast::Client
+ def initialize
+ textdomain "firstboot"
+ end
+
+ def run
+ result = WFM.CallFunction("inst_license", inst_license_args)
+
+ UI.CloseDialog if result == :halt
+
+ result
+ end
+
+ private
+
+ # Build, log, and returns args to be used for calling InstLicense client
+ #
+ # @return [Array]
+ def inst_license_args
+ args = GetInstArgs.argmap
+ args["action"] = refusal_action
+ args["directories"] = licenses_directories
+
+ Builtins.y2milestone("inst_license options: %1", args)
+
+ [args]
+ end
+
+ # Action to perform if the user's refusal to accept the license agreement
+ #
+ # @return [String]
+ def refusal_action
+
Misc.SysconfigRead(path(".sysconfig.firstboot.LICENSE_REFUSAL_ACTION"), "abort")
+ end
+
+ # Directories in which look for the license agreement texts
+ #
+ # NOTE: if that result in an empty list, {Yast::InstLicenseClient} will
do
+ # an extra attemp to look for the license agreement in the path given as
+ # "base_product_license_directory" global param through the control file.
+ #
+ # @return [Array<String>] license agreement paths
+ def licenses_directories
+ directories = [
+
Misc.SysconfigRead(path(".sysconfig.firstboot.FIRSTBOOT_LICENSE_DIR"), ""),
+
Misc.SysconfigRead(path(".sysconfig.firstboot.FIRSTBOOT_NOVELL_LICENSE_DIR"),
"")
+ ]
+
+ directories.uniq.reject(&:empty?)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-firstboot-4.1.6/test/test_helper.rb
new/yast2-firstboot-4.1.7/test/test_helper.rb
--- old/yast2-firstboot-4.1.6/test/test_helper.rb 2019-04-11
14:19:35.000000000 +0200
+++ new/yast2-firstboot-4.1.7/test/test_helper.rb 2019-05-13
16:28:37.000000000 +0200
@@ -16,7 +16,8 @@
# for coverage we need to load all ruby files
src_location = File.expand_path("../../src", __FILE__)
- Dir["#{src_location}/{module,lib}/**/*.rb"].each { |f| require_relative f }
+ # track all ruby files under src
+ SimpleCov.track_files("#{src_location}/**/*.rb")
# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-firstboot-4.1.6/test/y2firstboot/clients/licenses_test.rb
new/yast2-firstboot-4.1.7/test/y2firstboot/clients/licenses_test.rb
--- old/yast2-firstboot-4.1.6/test/y2firstboot/clients/licenses_test.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-firstboot-4.1.7/test/y2firstboot/clients/licenses_test.rb
2019-05-13 16:28:37.000000000 +0200
@@ -0,0 +1,112 @@
+#!/usr/bin/env rspec
+# encoding: utf-8
+
+# Copyright (c) [2019] 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 "y2firstboot/clients/licenses"
+
+describe Y2Firstboot::Clients::Licenses do
+ subject(:client) { described_class.new }
+
+ let(:firstboot_license_dir) { "" }
+ let(:firstboot_novell_license_dir) { "" }
+ let(:client_response) { :whatever }
+
+ before do
+ allow(Yast::Misc).to receive(:SysconfigRead)
+ .with(Yast::Path.new(".sysconfig.firstboot.LICENSE_REFUSAL_ACTION"),
anything)
+
+ allow(Yast::Misc).to receive(:SysconfigRead)
+ .with(Yast::Path.new(".sysconfig.firstboot.FIRSTBOOT_LICENSE_DIR"),
anything)
+ .and_return(firstboot_license_dir)
+
+ allow(Yast::Misc).to receive(:SysconfigRead)
+
.with(Yast::Path.new(".sysconfig.firstboot.FIRSTBOOT_NOVELL_LICENSE_DIR"),
anything)
+ .and_return(firstboot_novell_license_dir)
+
+ allow(Yast::WFM).to receive(:CallFunction)
+ .and_return(client_response)
+ end
+
+ describe "#run" do
+ context "when FIRSTBOOT_LICENSE_DIR is defined" do
+ let(:firstboot_license_dir) { "/path/to/licenses" }
+ let(:firstboot_novell_license_dir) { "" }
+ let(:expected_arg) do
+ { "directories" => [firstboot_license_dir] }
+ end
+
+ it "includes it as arg for InstLicense client" do
+ expect(Yast::WFM).to receive(:CallFunction)
+ .with("inst_license", array_including(hash_including(expected_arg)))
+
+ subject.run
+ end
+ end
+
+ context "when FIRSTBOOT_NOVELL_LICENSE_DIR is defined" do
+ let(:firstboot_license_dir) { "" }
+ let(:firstboot_novell_license_dir) { "/path/to/novell/licenses" }
+ let(:expected_arg) do
+ { "directories" => [firstboot_novell_license_dir] }
+ end
+
+ it "includes it as arg for InstLicense client" do
+ expect(Yast::WFM).to receive(:CallFunction)
+ .with("inst_license", array_including(hash_including(expected_arg)))
+
+ subject.run
+ end
+ end
+
+ context "when both, FIRSTBOOT_LICENSE_DIR and
FIRSTBOOT_NOVELL_LICENSE_DIR, are defined" do
+ let(:firstboot_license_dir) { "/path/to/licenses" }
+ let(:firstboot_novell_license_dir) { "/path/to/novell/licenses" }
+ let(:expected_arg) do
+ { "directories" => [firstboot_license_dir,
firstboot_novell_license_dir] }
+ end
+
+ it "includes them as arg for InstLicense client" do
+ # the matcher is also ensuring the right licenses order
+ expect(Yast::WFM).to receive(:CallFunction)
+ .with("inst_license", array_including(hash_including(expected_arg)))
+
+ subject.run
+ end
+ end
+ end
+
+ context "when InstLicense client finish" do
+ context "and it returns :halt" do
+ let(:client_response) { :halt }
+
+ it "closes the dialog" do
+ expect(Yast::UI).to receive(:CloseDialog)
+
+ subject.run
+ end
+ end
+
+ it "returns the response of InstLicense client" do
+ expect(subject.run).to eq(client_response)
+ end
+ end
+end