Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2014-08-20 17:54:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2014-08-11 10:09:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2014-08-20 17:54:26.000000000 +0200 @@ -1,0 +2,36 @@ +Wed Aug 20 10:11:10 CEST 2014 - [email protected] + +- Fixed RPM description (bnc#888994) +- 3.1.100 + +------------------------------------------------------------------- +Wed Aug 13 14:37:19 UTC 2014 - [email protected] + +- Untrusted repositories are disabled during installation to avoid + asking for the key import over and over during the installation. +- Fixed bnc#723019 and bnc#886572 +- 3.1.99 + +------------------------------------------------------------------- +Wed Aug 13 14:36:23 CEST 2014 - [email protected] + +- Package.rb: Each call is polling which installation mode is + active currently. So Mode.rb has not to take care about modules + which are using Mode.rb. (Fixing current testcases) +- 3.1.98 + +------------------------------------------------------------------- +Tue Aug 12 16:35:30 CEST 2014 - [email protected] + +- Fixed checking for SuSEfirewall2 package installed/selected + for installation depending on the current stage/mode (bnc#887406) +- 3.1.97 + +------------------------------------------------------------------- +Tue Aug 12 12:13:36 CEST 2014 - [email protected] + +- When changing installation mode in "Mode.rb" the mode in Package.rb + has to be updated too. (bnc#888212) +- 3.1.96 + +------------------------------------------------------------------- Old: ---- yast2-3.1.95.tar.bz2 New: ---- yast2-3.1.100.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.3f82gv/_old 2014-08-20 17:54:28.000000000 +0200 +++ /var/tmp/diff_new_pack.3f82gv/_new 2014-08-20 17:54:28.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.95 +Version: 3.1.100 Release: 0 Url: https://github.com/yast/yast-yast2 @@ -139,7 +139,7 @@ Group: System/YaST %description -This package contains scripts and data needed for SuSE Linux +This package contains scripts and data needed for SUSE Linux installation with YaST2 %package devel-doc ++++++ yast2-3.1.95.tar.bz2 -> yast2-3.1.100.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/cwm/doc/cwm.xml new/yast2-3.1.100/library/cwm/doc/cwm.xml --- old/yast2-3.1.95/library/cwm/doc/cwm.xml 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/library/cwm/doc/cwm.xml 2014-08-20 10:42:21.000000000 +0200 @@ -28,7 +28,7 @@ <firstname>Jiri</firstname> <surname>Srain</surname> </author> - <copyright><year>2003</year><holder>SuSE Linux AG</holder></copyright> + <copyright><year>2003</year><holder>SUSE LLC</holder></copyright> <legalnotice id="id_legal"> <para>This document is meant for YaST2 development only.</para> </legalnotice> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/network/src/modules/SuSEFirewall.rb new/yast2-3.1.100/library/network/src/modules/SuSEFirewall.rb --- old/yast2-3.1.95/library/network/src/modules/SuSEFirewall.rb 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/library/network/src/modules/SuSEFirewall.rb 2014-08-20 10:42:21.000000000 +0200 @@ -54,6 +54,7 @@ Yast.import "FileUtils" Yast.import "Directory" Yast.import "Stage" + Yast.import "Pkg" # <!-- SuSEFirewall VARIABLES //--> @@ -1101,30 +1102,24 @@ nil end - # Returns whether all needed packages are installed. + # Returns whether all needed packages are installed (or selected for + # installation) # # @return [Boolean] whether SuSEfirewall2 is installed def SuSEFirewallIsInstalled - if @needed_packages_installed == nil - # In mode normal, package can be installed on request - # if required by the module - if @check_and_install_package && Mode.normal - @needed_packages_installed = PackageSystem.CheckAndInstallPackages( - [@FIREWALL_PACKAGE] - ) - Builtins.y2milestone( - "CheckAndInstallPackages -> %1", - @needed_packages_installed - ) - # In mode install/update network might be down + # Always recheck the status in inst-sys, user/solver might have change + # the list of packages selected for installation + if Stage.initial + @needed_packages_installed = Pkg.IsSelected(@FIREWALL_PACKAGE) + log.info "Selected for installation -> #{@needed_packages_installed}" + elsif @needed_packages_installed.nil? + if Mode.normal + @needed_packages_installed = PackageSystem.CheckAndInstallPackages([@FIREWALL_PACKAGE]) + log.info "CheckAndInstallPackages -> #{@needed_packages_installed}" else - @needed_packages_installed = PackageSystem.Installed( - @FIREWALL_PACKAGE - ) - Builtins.y2milestone("Installed -> %1", @needed_packages_installed) + @needed_packages_installed = PackageSystem.Installed(@FIREWALL_PACKAGE) + log.info "Installed -> #{@needed_packages_installed}" end - elsif @needed_packages_installed == false - Builtins.y2milestone("SuSEfirewall2 is not installed, skipping...") end @needed_packages_installed @@ -3904,6 +3899,7 @@ publish :function => :GetServicesAcceptRelated, :type => "list <string> (string)" publish :function => :SetServicesAcceptRelated, :type => "void (string, list <string>)" publish :function => :RemoveOldAllowedServiceFromZone, :type => "void (map <string, any>, string)", :private => true + publish :variable => :needed_packages_installed, :type => "boolean" end SuSEFirewall = SuSEFirewallClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/network/test/susefirewall_test.rb new/yast2-3.1.100/library/network/test/susefirewall_test.rb --- old/yast2-3.1.95/library/network/test/susefirewall_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.1.100/library/network/test/susefirewall_test.rb 2014-08-20 10:42:21.000000000 +0200 @@ -0,0 +1,80 @@ +#! /usr/bin/rspec + +top_srcdir = File.expand_path("../../../..", __FILE__) +inc_dirs = Dir.glob("#{top_srcdir}/library/*/src") +ENV["Y2DIR"] = inc_dirs.join(":") + +require "yast" + +Yast.import "Mode" +Yast.import "PackageSystem" +Yast.import "Pkg" +Yast.import "SuSEFirewall" +Yast.import "Stage" + +FW_PACKAGE = "SuSEfirewall2" + +def reset_SuSEFirewallIsInstalled_cache + Yast::SuSEFirewall.needed_packages_installed = nil +end + +describe Yast::SuSEFirewall do + describe "#SuSEFirewallIsInstalled" do + before(:each) do + reset_SuSEFirewallIsInstalled_cache + end + + context "while in inst-sys" do + it "returns whether SuSEfirewall2 is selected for installation" do + expect(Yast::Stage).to receive(:stage).and_return("initial").at_least(:once) + + # Value is not cached + expect(Yast::Pkg).to receive(:IsSelected).and_return(true, false, true).exactly(3).times + + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + end + end + + context "while on a running system (normal configuration)" do + it "returns whether SuSEfirewall2 was or could have been installed" do + expect(Yast::Stage).to receive(:stage).and_return("normal").at_least(:once) + expect(Yast::Mode).to receive(:mode).and_return("normal").at_least(:once) + + # Value is cached + expect(Yast::PackageSystem).to receive(:CheckAndInstallPackages).and_return(true, false).twice + + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + + reset_SuSEFirewallIsInstalled_cache + + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + end + end + + context "while in AutoYast config" do + it "returns whether SuSEfirewall2 is installed" do + expect(Yast::Stage).to receive(:stage).and_return("normal").at_least(:once) + expect(Yast::Mode).to receive(:mode).and_return("autoinst_config").at_least(:once) + + # Value is cached + expect(Yast::PackageSystem).to receive(:Installed).and_return(false, true).twice + + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_false + + reset_SuSEFirewallIsInstalled_cache + + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + expect(Yast::SuSEFirewall.SuSEFirewallIsInstalled).to be_true + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/packages/src/modules/Package.rb new/yast2-3.1.100/library/packages/src/modules/Package.rb --- old/yast2-3.1.95/library/packages/src/modules/Package.rb 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/library/packages/src/modules/Package.rb 2014-08-20 10:42:21.000000000 +0200 @@ -116,20 +116,25 @@ ) } - @Functions = Mode.config ? @FunctionsAI : @FunctionsSystem - @last_op_canceled = false Yast.include self, "packages/common.rb" end + # If Yast is running in the autoyast configuration mode + # no changes will be done on the target system by using + # the PackageAI class. + def functions + Mode.config ? @FunctionsAI : @FunctionsSystem + end + # Install list of packages # @param [Array<String>] packages list of packages to be installed # @return True on success def DoInstall(packages) packages = deep_copy(packages) function = Convert.convert( - Ops.get(@Functions, "DoInstall"), + Ops.get(functions, "DoInstall"), :from => "any", :to => "boolean (list <string>)" ) @@ -142,7 +147,7 @@ def DoRemove(packages) packages = deep_copy(packages) function = Convert.convert( - Ops.get(@Functions, "DoRemove"), + Ops.get(functions, "DoRemove"), :from => "any", :to => "boolean (list <string>)" ) @@ -157,7 +162,7 @@ toinstall = deep_copy(toinstall) toremove = deep_copy(toremove) function = Convert.convert( - Ops.get(@Functions, "DoInstallAndRemove"), + Ops.get(functions, "DoInstallAndRemove"), :from => "any", :to => "boolean (list <string>, list <string>)" ) @@ -166,7 +171,7 @@ def Available(package) function = Convert.convert( - Ops.get(@Functions, "Available"), + Ops.get(functions, "Available"), :from => "any", :to => "boolean (string)" ) @@ -175,7 +180,7 @@ def Installed(package) function = Convert.convert( - Ops.get(@Functions, "Installed"), + Ops.get(functions, "Installed"), :from => "any", :to => "boolean (string)" ) @@ -184,7 +189,7 @@ def PackageAvailable(package) function = Convert.convert( - Ops.get(@Functions, "PackageAvailable"), + Ops.get(functions, "PackageAvailable"), :from => "any", :to => "boolean (string)" ) @@ -193,7 +198,7 @@ def PackageInstalled(package) function = Convert.convert( - Ops.get(@Functions, "PackageInstalled"), + Ops.get(functions, "PackageInstalled"), :from => "any", :to => "boolean (string)" ) @@ -203,7 +208,7 @@ def InstallKernel(kernel_modules) kernel_modules = deep_copy(kernel_modules) function = Convert.convert( - Ops.get(@Functions, "InstallKernel"), + Ops.get(functions, "InstallKernel"), :from => "any", :to => "boolean (list <string>)" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/packages/src/modules/PackageCallbacks.rb new/yast2-3.1.100/library/packages/src/modules/PackageCallbacks.rb --- old/yast2-3.1.95/library/packages/src/modules/PackageCallbacks.rb 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/library/packages/src/modules/PackageCallbacks.rb 2014-08-20 10:42:21.000000000 +0200 @@ -47,6 +47,7 @@ Yast.import "Directory" Yast.import "Label" Yast.import "Mode" + Yast.import "Stage" Yast.import "Popup" Yast.import "URL" Yast.import "CommandLine" @@ -3149,9 +3150,12 @@ "boolean (string, string, integer)" ) ) + # During installation untrusted repositories are disabled to avoid + # asking again + gpg_callback = Stage.initial ? :import_gpg_key_or_disable : :ImportGpgKey Pkg.CallbackImportGpgKey( fun_ref( - SignatureCheckCallbacks.method(:ImportGpgKey), + SignatureCheckCallbacks.method(gpg_callback), "boolean (map <string, any>, integer)" ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/packages/src/modules/SignatureCheckCallbacks.rb new/yast2-3.1.100/library/packages/src/modules/SignatureCheckCallbacks.rb --- old/yast2-3.1.95/library/packages/src/modules/SignatureCheckCallbacks.rb 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/library/packages/src/modules/SignatureCheckCallbacks.rb 2014-08-20 10:42:21.000000000 +0200 @@ -31,10 +31,13 @@ module Yast class SignatureCheckCallbacksClass < Module + include Yast::Logger + def main textdomain "base" Yast.import "SignatureCheckDialogs" + Yast.import "Pkg" # Default return when signatures shouldn't be checked @@ -241,6 +244,21 @@ SignatureCheckDialogs.ImportGPGKeyIntoTrustedDialog(key, repo_id) end + # Alternative implementation of #ImportGpgKey, used during installation, + # that disables the repository if the key is not trusted and enables it + # otherwise (a single call to Pkg.ServiceRefresh asks the user several + # times for the same repository, last decision must prevail). + # + # zypp: askUserToImportKey + # + # function for CallbackImportGpgKey() + def import_gpg_key_or_disable(key, repo_id) + trusted = ImportGpgKey(key, repo_id) + log.info "Setting enabled to #{trusted} for repo #{repo_id}, due to user reply to ImportGpgKey" + Pkg.SourceSetEnabled(repo_id, trusted) + trusted + end + # Name of the callback handler function. Required callback prototype is # boolean(string filename, map<string,any> key). The callback # function should ask user whether the unsigned file can be accepted, @@ -299,6 +317,7 @@ publish :function => :AcceptUnknownDigest, :type => "boolean (string, string)" publish :function => :AcceptUnknownGpgKey, :type => "boolean (string, string, integer)" publish :function => :ImportGpgKey, :type => "boolean (map <string, any>, integer)" + publish :function => :import_gpg_key_or_disable, :type => "boolean (map <string, any>, integer)" publish :function => :AcceptVerificationFailed, :type => "boolean (string, map <string, any>, integer)" publish :function => :TrustedKeyAdded, :type => "void (map <string, any>)" publish :function => :TrustedKeyRemoved, :type => "void (map <string, any>)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/library/packages/test/signature_check_callbacks_test.rb new/yast2-3.1.100/library/packages/test/signature_check_callbacks_test.rb --- old/yast2-3.1.95/library/packages/test/signature_check_callbacks_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.1.100/library/packages/test/signature_check_callbacks_test.rb 2014-08-20 10:42:21.000000000 +0200 @@ -0,0 +1,41 @@ +#! /usr/bin/rspec + +top_srcdir = File.expand_path("../../../..", __FILE__) +inc_dirs = Dir.glob("#{top_srcdir}/library/*/src") +ENV["Y2DIR"] = inc_dirs.join(":") + +require "yast" + +module Yast + + import "SignatureCheckCallbacks" + import "Pkg" + import "SignatureCheckDialogs" + + describe SignatureCheckCallbacks do + describe "#import_gpg_key_or_disable" do + + # Values of repo_id and key are irrelevant for this test + let(:repo_id) { 1 } + let(:key) { {} } + + before(:each) do + allow(SignatureCheckDialogs).to receive(:CheckSignaturesInYaST).and_return true + end + + it "enables repositories with accepted key" do + allow(SignatureCheckDialogs).to receive(:ImportGPGKeyIntoTrustedDialog).and_return true + expect(Pkg).to receive(:SourceSetEnabled).with(repo_id, true) + + SignatureCheckCallbacks.import_gpg_key_or_disable(key, repo_id) + end + + it "disables repositories with rejected key" do + allow(SignatureCheckDialogs).to receive(:ImportGPGKeyIntoTrustedDialog).and_return false + expect(Pkg).to receive(:SourceSetEnabled).with(repo_id, false) + + SignatureCheckCallbacks.import_gpg_key_or_disable(key, repo_id) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/package/yast2.changes new/yast2-3.1.100/package/yast2.changes --- old/yast2-3.1.95/package/yast2.changes 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/package/yast2.changes 2014-08-20 10:42:21.000000000 +0200 @@ -1,4 +1,40 @@ ------------------------------------------------------------------- +Wed Aug 20 10:11:10 CEST 2014 - [email protected] + +- Fixed RPM description (bnc#888994) +- 3.1.100 + +------------------------------------------------------------------- +Wed Aug 13 14:37:19 UTC 2014 - [email protected] + +- Untrusted repositories are disabled during installation to avoid + asking for the key import over and over during the installation. +- Fixed bnc#723019 and bnc#886572 +- 3.1.99 + +------------------------------------------------------------------- +Wed Aug 13 14:36:23 CEST 2014 - [email protected] + +- Package.rb: Each call is polling which installation mode is + active currently. So Mode.rb has not to take care about modules + which are using Mode.rb. (Fixing current testcases) +- 3.1.98 + +------------------------------------------------------------------- +Tue Aug 12 16:35:30 CEST 2014 - [email protected] + +- Fixed checking for SuSEfirewall2 package installed/selected + for installation depending on the current stage/mode (bnc#887406) +- 3.1.97 + +------------------------------------------------------------------- +Tue Aug 12 12:13:36 CEST 2014 - [email protected] + +- When changing installation mode in "Mode.rb" the mode in Package.rb + has to be updated too. (bnc#888212) +- 3.1.96 + +------------------------------------------------------------------- Thu Aug 7 12:14:16 UTC 2014 - [email protected] - SuSEFirewall: Reading SuSEfirewall2 configuration whenever it's diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.95/package/yast2.spec new/yast2-3.1.100/package/yast2.spec --- old/yast2-3.1.95/package/yast2.spec 2014-08-07 14:56:44.000000000 +0200 +++ new/yast2-3.1.100/package/yast2.spec 2014-08-20 10:42:21.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2 # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013-2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.95 +Version: 3.1.100 Release: 0 URL: https://github.com/yast/yast-yast2 @@ -125,7 +125,7 @@ Summary: YaST2 - Main Package %description -This package contains scripts and data needed for SuSE Linux +This package contains scripts and data needed for SUSE Linux installation with YaST2 %package devel-doc -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
