Hello community, here is the log from the commit of package yast2-kdump for openSUSE:Factory checked in at 2019-10-03 14:05:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-kdump (Old) and /work/SRC/openSUSE:Factory/.yast2-kdump.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-kdump" Thu Oct 3 14:05:45 2019 rev:96 rq:733469 version:4.2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-kdump/yast2-kdump.changes 2019-08-30 14:40:01.549433518 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-kdump.new.2352/yast2-kdump.changes 2019-10-03 14:05:46.156669855 +0200 @@ -1,0 +2,7 @@ +Thu Sep 26 12:25:08 UTC 2019 - Josef Reidinger <[email protected]> + +- fix installing kdump to first stage when kdump enabled in + AutoYaST (bsc#1149208) +- 4.2.5 + +------------------------------------------------------------------- Old: ---- yast2-kdump-4.2.4.tar.bz2 New: ---- yast2-kdump-4.2.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-kdump.spec ++++++ --- /var/tmp/diff_new_pack.0HbpK7/_old 2019-10-03 14:05:46.636668620 +0200 +++ /var/tmp/diff_new_pack.0HbpK7/_new 2019-10-03 14:05:46.640668610 +0200 @@ -17,7 +17,7 @@ Name: yast2-kdump -Version: 4.2.4 +Version: 4.2.5 Release: 0 Summary: Configuration of kdump License: GPL-2.0-only ++++++ yast2-kdump-4.2.4.tar.bz2 -> yast2-kdump-4.2.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.2.4/package/yast2-kdump.changes new/yast2-kdump-4.2.5/package/yast2-kdump.changes --- old/yast2-kdump-4.2.4/package/yast2-kdump.changes 2019-08-28 13:14:06.000000000 +0200 +++ new/yast2-kdump-4.2.5/package/yast2-kdump.changes 2019-09-26 16:12:29.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Sep 26 12:25:08 UTC 2019 - Josef Reidinger <[email protected]> + +- fix installing kdump to first stage when kdump enabled in + AutoYaST (bsc#1149208) +- 4.2.5 + +------------------------------------------------------------------- Wed Aug 28 09:52:34 CEST 2019 - [email protected] - Removed empty entry in desktop file (bsc#144894). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.2.4/package/yast2-kdump.spec new/yast2-kdump-4.2.5/package/yast2-kdump.spec --- old/yast2-kdump-4.2.4/package/yast2-kdump.spec 2019-08-28 13:14:06.000000000 +0200 +++ new/yast2-kdump-4.2.5/package/yast2-kdump.spec 2019-09-26 16:12:29.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-kdump -Version: 4.2.4 +Version: 4.2.5 Release: 0 Summary: Configuration of kdump License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.2.4/src/clients/kdump_auto.rb new/yast2-kdump-4.2.5/src/clients/kdump_auto.rb --- old/yast2-kdump-4.2.4/src/clients/kdump_auto.rb 2019-08-28 13:14:06.000000000 +0200 +++ new/yast2-kdump-4.2.5/src/clients/kdump_auto.rb 2019-09-26 16:12:29.000000000 +0200 @@ -1,109 +1,3 @@ -# encoding: utf-8 +require "kdump/clients/auto" -# File: -# kdump_auto.ycp -# -# Module: -# Kdump installation and configuration -# -# Summary: -# Kdump autoinstallation preparation -# -# Authors: -# Jozef Uhliarik <[email protected]> -# -# -module Yast - class KdumpAutoClient < Client - def main - Yast.import "UI" - textdomain "kdump" - - Builtins.y2milestone("----------------------------------------") - Builtins.y2milestone("kdump auto started") - - Yast.import "Kdump" - Yast.import "Mode" - Yast.import "Progress" - - Yast.include self, "kdump/wizards.rb" - - @progress_orig = Progress.set(false) - - @ret = nil - @func = "" - @param = {} - - # Check arguments - 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.to_map(WFM.Args(1)) - end - end - Builtins.y2debug("func=%1", @func) - Builtins.y2debug("param=%1", @param) - - if @func == "Import" - @ret = Kdump.Import(@param) - # Create a summary - # return string - elsif @func == "Summary" - @ret = Ops.add( - Ops.add( - "<UL>", - Builtins.mergestring(Builtins.maplist(Kdump.Summary) do |l| - Ops.add("<LI>", l) - end, "\n") - ), - "</UL>" - ) - # did configuration changed - # return boolean - elsif @func == "GetModified" - @ret = Kdump.GetModified - # set configuration as changed - # return boolean - elsif @func == "SetModified" - Kdump.SetModified - @ret = true - # Reset configuration - # return map or list - elsif @func == "Reset" - Kdump.Import({}) - @ret = {} - # Change configuration - # return symbol (i.e. `finish || `accept || `next || `cancel || `abort) - elsif @func == "Change" - @ret = KdumpAutoSequence() - return deep_copy(@ret) - # Return configuration data - # return map or list - elsif @func == "Export" - @ret = Kdump.Export - # Write configuration data - # return boolean - elsif @func == "Write" - @ret = Kdump.Write - elsif @func == "Read" - @ret = Kdump.Read - else - Builtins.y2error("unknown function: %1", @func) - @ret = false - end - Progress.set(@progress_orig) - - Builtins.y2debug("ret=%1", @ret) - Builtins.y2milestone("kdump_auto finished") - Builtins.y2milestone("----------------------------------------") - - deep_copy(@ret) - - # EOF - end - end -end - -Yast::KdumpAutoClient.new.main +Y2Kdump::Clients::Auto.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.2.4/src/lib/kdump/clients/auto.rb new/yast2-kdump-4.2.5/src/lib/kdump/clients/auto.rb --- old/yast2-kdump-4.2.4/src/lib/kdump/clients/auto.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-kdump-4.2.5/src/lib/kdump/clients/auto.rb 2019-09-26 16:12:29.000000000 +0200 @@ -0,0 +1,88 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2019 SUSE LLC +# +# 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. +# +# ------------------------------------------------------------------------------ + +require "installation/auto_client" + +Yast.import "Kdump" +Yast.import "Mode" +Yast.import "Progress" +Yast.import "PackagesProposal" + +module Y2Kdump + module Clients + # Client to communicate with autoyast + class Auto < ::Installation::AutoClient + def initialize + textdomain "kdump" + + Yast.include self, "kdump/wizards.rb" # needed for auto sequence + end + + def import(profile) + Yast::Kdump.Import(profile) + # add packages needed to proposal, as it is needed already in first stage (bsc#1149208) + Yast::PackagesProposal.AddResolvables("yast2-kdump", :package, packages["install"]) + end + + def export + Yast::Kdump.Export + end + + def summary + items = Yast::Kdump.Summary.map { |s| "<li>#{s}</li>" } + "<ul>#{items.join("\n")}</ul>" + end + + def modified? + Yast::Kdump.GetModified + end + + def modified + Yast::Kdump.SetModified + end + + def reset + Yast::Kdump.Import({}) + end + + def change + KdumpAutoSequence() + end + + def write + progress_orig = Yast::Progress.set(false) + Yast::Kdump.Write + Yast::Progress.set(progress_orig) + end + + def read + progress_orig = Yast::Progress.set(false) + Yast::Kdump.Read + Yast::Progress.set(progress_orig) + end + + def packages + if Yast::Kdump.add_crashkernel_param + { + "install" => Yast::KdumpClass::KDUMP_PACKAGES, + "remove" => [] + } + else + {} + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.2.4/test/auto_test.rb new/yast2-kdump-4.2.5/test/auto_test.rb --- old/yast2-kdump-4.2.4/test/auto_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-kdump-4.2.5/test/auto_test.rb 2019-09-26 16:12:29.000000000 +0200 @@ -0,0 +1,76 @@ +#!/usr/bin/env rspec + +require_relative "./test_helper" + +require "kdump/clients/auto" + +describe Y2Kdump::Clients::Auto do + describe "#import" do + it "imports given hash" do + expect(Yast::Kdump).to receive(:Import).with({}) + subject.import({}) + end + end + + describe "#export" do + it "returns hash" do + expect(subject.export).to be_a ::Hash + end + end + + describe "#summary" do + it "returns a string" do + expect(subject.summary).to be_a ::String + end + end + + describe "#modified" do + it "sets modified flag" do + subject.modified + expect(subject.modified?).to eq true + end + end + + describe "#reset" do + it "import empty data" do + expect(Yast::Kdump).to receive(:Import).with({}) + subject.reset + end + end + + describe "#read" do + it "reads system kdump settings" do + expect(Yast::Kdump).to receive(:Read) + subject.read + end + end + + describe "#write" do + it "writes settings to system" do + expect(Yast::Kdump).to receive(:Write) + subject.write + end + end + + describe "#packages" do + before do + allow(Yast::Kdump).to receive(:add_crashkernel_param).and_return(enabled) + end + + context "kdump is enabled" do + let(:enabled) { true } + + it "returns list of packages to install" do + expect(subject.packages).to eq("install" => ["kexec-tools", "kdump"], "remove" => []) + end + end + + context "kdump is disabled" do + let(:enabled) { false } + + it "returns empty list" do + expect(subject.packages).to eq({}) + end + end + end +end
