Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2016-11-25 12:05:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2016-11-23 13:35:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2016-11-25 12:05:12.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Nov 23 15:23:24 UTC 2016 - igonzalezs...@suse.com + +- Fix replacement of workflow modules (bsc#1011869) +- 3.2.6 + +------------------------------------------------------------------- Old: ---- yast2-3.2.5.tar.bz2 New: ---- yast2-3.2.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.OL9Qbi/_old 2016-11-25 12:05:13.000000000 +0100 +++ /var/tmp/diff_new_pack.OL9Qbi/_new 2016-11-25 12:05:13.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.2.5 +Version: 3.2.6 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0 ++++++ yast2-3.2.5.tar.bz2 -> yast2-3.2.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.5/library/control/src/modules/WorkflowManager.rb new/yast2-3.2.6/library/control/src/modules/WorkflowManager.rb --- old/yast2-3.2.5/library/control/src/modules/WorkflowManager.rb 2016-11-21 09:22:01.000000000 +0100 +++ new/yast2-3.2.6/library/control/src/modules/WorkflowManager.rb 2016-11-23 17:54:27.000000000 +0100 @@ -39,6 +39,8 @@ module Yast class WorkflowManagerClass < Module + include Yast::Logger + def main Yast.import "UI" Yast.import "Pkg" @@ -748,7 +750,7 @@ found = false modules = Builtins.maplist(Ops.get_list(workflow, "modules", [])) do |m| - next if Ops.get_string(m, "name", "") != old + next [m] if Ops.get_string(m, "name", "") != old new_list = Builtins.maplist(new) do |n| Ops.set(n, "textdomain", domain) @@ -762,15 +764,8 @@ deep_copy(new_list) end - if !found - Builtins.y2internal( - "Insert/Replace/Remove workflow module %1 not found", - old - ) - end - + log.warn("Insert/Replace/Remove workflow module '#{old}' not found") if !found Ops.set(workflow, "modules", Builtins.flatten(modules)) - deep_copy(workflow) end @@ -783,6 +778,7 @@ def MergeWorkflow(base, addon, _prod_name, domain) base = deep_copy(base) addon = deep_copy(addon) + # Merging - removing steps, settings removes = Ops.get_list(addon, "remove_modules", []) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.5/library/control/test/Makefile.am new/yast2-3.2.6/library/control/test/Makefile.am --- old/yast2-3.2.5/library/control/test/Makefile.am 2016-11-21 09:22:01.000000000 +0100 +++ new/yast2-3.2.6/library/control/test/Makefile.am 2016-11-23 17:54:27.000000000 +0100 @@ -1,6 +1,7 @@ TESTS = \ InstExtensionImage_test.rb \ - ProductFeatures_test.rb + ProductFeatures_test.rb \ + workflow_manager_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.5/library/control/test/workflow_manager_test.rb new/yast2-3.2.6/library/control/test/workflow_manager_test.rb --- old/yast2-3.2.5/library/control/test/workflow_manager_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.2.6/library/control/test/workflow_manager_test.rb 2016-11-23 17:54:27.000000000 +0100 @@ -0,0 +1,58 @@ +#!/usr/bin/env rspec + +require_relative "test_helper" + +Yast.import "WorkflowManager" + +describe Yast::WorkflowManager do + subject { Yast::WorkflowManager } + + describe "#ReplaceWorkflowModule" do + let(:workflow) do + { + "defaults" => { "archs" => "all" }, + "stage" => "continue", + "mode" => "autoinstallation", + "modules" => [ + { "label" => "Perform Installation", "name" => "autopost" }, + { "label" => "System Configuration", "name" => "autoconfigure" } + ] + } + end + let(:old) { "autoconfigure" } + let(:new) { { "label" => "Custom Module", "name" => "custom" } } + let(:domain) { "some-domain" } + let(:keep) { true } + + context "when keep is set to true" do + it "inserts the new modules before the old one" do + replaced = subject.ReplaceWorkflowModule(workflow, old, [new], domain, keep) + expect(replaced["modules"]).to include(new.merge("textdomain" => domain)) + + modules = replaced["modules"].map { |m| m["name"] } + expect(modules).to eq(["autopost", "custom", "autoconfigure"]) + end + end + + context "when keep is set to false" do + let(:keep) { false } + it "replaces the old one with the new modules" do + replaced = subject.ReplaceWorkflowModule(workflow, old, [new], domain, keep) + expect(replaced["modules"]).to include(new.merge("textdomain" => domain)) + + modules = replaced["modules"].map { |m| m["name"] } + expect(modules).to eq(["autopost", "custom"]) + end + end + + context "when the old module is not found" do + let(:old) { "proposal" } + + it "does not modify the workflow and logs the error" do + expect(subject.log).to receive(:warn).with(/workflow module 'proposal' not found/) + replaced = subject.ReplaceWorkflowModule(workflow, old, [new], domain, keep) + expect(replaced).to eq(workflow) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.5/package/yast2.changes new/yast2-3.2.6/package/yast2.changes --- old/yast2-3.2.5/package/yast2.changes 2016-11-21 09:22:02.000000000 +0100 +++ new/yast2-3.2.6/package/yast2.changes 2016-11-23 17:54:28.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Nov 23 15:23:24 UTC 2016 - igonzalezs...@suse.com + +- Fix replacement of workflow modules (bsc#1011869) +- 3.2.6 + +------------------------------------------------------------------- Fri Nov 18 16:33:56 UTC 2016 - lsle...@suse.cz - Remove the restart file when starting YaST to avoid possible diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.5/package/yast2.spec new/yast2-3.2.6/package/yast2.spec --- old/yast2-3.2.5/package/yast2.spec 2016-11-21 09:22:02.000000000 +0100 +++ new/yast2-3.2.6/package/yast2.spec 2016-11-23 17:54:28.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.2.5 +Version: 3.2.6 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0