Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2021-12-18 20:29:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old) and /work/SRC/openSUSE:Factory/.autoyast2.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2" Sat Dec 18 20:29:22 2021 rev:311 rq:941196 version:4.4.24 Changes: -------- --- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2021-11-28 21:30:16.898043026 +0100 +++ /work/SRC/openSUSE:Factory/.autoyast2.new.2520/autoyast2.changes 2021-12-18 20:29:24.694214739 +0100 @@ -1,0 +2,6 @@ +Fri Dec 17 10:33:33 UTC 2021 - Steffen Winterfeldt <snw...@suse.com> + +- use Y2Storage::Arch to determine whether UEFI is available (bsc#937067) +- 4.4.24 + +------------------------------------------------------------------- Old: ---- autoyast2-4.4.23.tar.bz2 New: ---- autoyast2-4.4.24.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ autoyast2.spec ++++++ --- /var/tmp/diff_new_pack.f9fOJn/_old 2021-12-18 20:29:26.086215512 +0100 +++ /var/tmp/diff_new_pack.f9fOJn/_new 2021-12-18 20:29:26.090215514 +0100 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.4.23 +Version: 4.4.24 Release: 0 Summary: YaST2 - Automated Installation License: GPL-2.0-only @@ -56,8 +56,8 @@ BuildRequires: yast2-update >= 3.3.0 # Required for test suite testing one time sync BuildRequires: yast2-ntp-client >= 4.0.1 -# New API for Y2Storage::PackageHandler and storage features -BuildRequires: yast2-storage-ng >= 4.2.95 +# UEFI detection in Y2Storage::Arch +BuildRequires: yast2-storage-ng >= 4.4.22 # %%{_unitdir} macro definition is in a separate package since 13.1 %if 0%{?suse_version} >= 1310 BuildRequires: systemd-rpm-macros ++++++ autoyast2-4.4.23.tar.bz2 -> autoyast2-4.4.24.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/package/autoyast2.changes new/autoyast2-4.4.24/package/autoyast2.changes --- old/autoyast2-4.4.23/package/autoyast2.changes 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/package/autoyast2.changes 2021-12-17 11:55:13.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Dec 17 10:33:33 UTC 2021 - Steffen Winterfeldt <snw...@suse.com> + +- use Y2Storage::Arch to determine whether UEFI is available (bsc#937067) +- 4.4.24 + +------------------------------------------------------------------- Thu Nov 25 12:56:23 UTC 2021 - Knut Anderssen <kanders...@suse.com> - During autoupgrade merge the selected product workflow in order diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/package/autoyast2.spec new/autoyast2-4.4.24/package/autoyast2.spec --- old/autoyast2-4.4.23/package/autoyast2.spec 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/package/autoyast2.spec 2021-12-17 11:55:13.000000000 +0100 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.4.23 +Version: 4.4.24 Release: 0 Summary: YaST2 - Automated Installation License: GPL-2.0-only @@ -56,8 +56,8 @@ BuildRequires: yast2-country # Required for test suite testing one time sync BuildRequires: yast2-ntp-client >= 4.0.1 -# New API for Y2Storage::PackageHandler and storage features -BuildRequires: yast2-storage-ng >= 4.2.95 +# UEFI detection in Y2Storage::Arch +BuildRequires: yast2-storage-ng >= 4.4.22 # %%{_unitdir} macro definition is in a separate package since 13.1 %if 0%{?suse_version} >= 1310 BuildRequires: systemd-rpm-macros diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/src/clients/software_auto.rb new/autoyast2-4.4.24/src/clients/software_auto.rb --- old/autoyast2-4.4.23/src/clients/software_auto.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/src/clients/software_auto.rb 2021-12-17 11:55:13.000000000 +0100 @@ -2,258 +2,6 @@ # Package: Autoinstallation Configuration System # Authors: Anas Nashif (nas...@suse.de) # Summary: Handle Package selections and packages -# -# $Id$ -require "y2packager/resolvable" - -module Yast - class SoftwareAutoClient < Client - def main - Yast.import "Pkg" - Yast.import "UI" - - textdomain "autoinst" - - Yast.import "Wizard" - Yast.import "Summary" - Yast.import "Report" - Yast.import "AutoinstConfig" - Yast.import "AutoinstSoftware" - Yast.import "Label" - Yast.import "PackageAI" - Yast.import "AutoInstall" - Yast.import "SourceManager" - Yast.import "PackagesUI" - Yast.import "Popup" - - Yast.include self, "autoinstall/dialogs.rb" - - @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) - - # create a summary - - if @func == "Summary" - @ret = AutoinstSoftware.Summary - elsif @func == "Import" - @ret = AutoinstSoftware.Import(@param) - elsif @func == "Read" - # use the previously saved software selection if defined (bsc#956325) - @ret = AutoinstSoftware.SavedPackageSelection || AutoinstSoftware.Read - elsif @func == "Reset" - AutoinstSoftware.Import({}) - @ret = {} - elsif @func == "Change" - @ret = packageSelector - elsif @func == "GetModified" - @ret = AutoinstSoftware.GetModified || PackageAI.GetModified - elsif @func == "SetModified" - AutoinstSoftware.SetModified - @ret = true - elsif @func == "Export" - @ret = AutoinstSoftware.Export - else - Builtins.y2error("unknown function: %1", @func) - @ret = false - end - - Builtins.y2debug("ret=%1", @ret) - Builtins.y2milestone("Software auto finished") - Builtins.y2milestone("----------------------------------------") - - deep_copy(@ret) - - # Finish - end - - # Select packages - # @return [Symbol] - def packageSelector - title = _("Software Selection") - helptext = _( - "<p>\n" \ - "Select one of the following <b>base</b> selections and click <i>Detailed<i> to add\n" \ - "more <b>add-on</b> selections and packages.\n" \ - "</p>\n" - ) - # Pkg::TargetFinish (); - Pkg.CallbackAcceptFileWithoutChecksum( - fun_ref( - AutoInstall.method(:callbackTrue_boolean_string), - "boolean (string)" - ) - ) - Pkg.CallbackAcceptUnsignedFile( - fun_ref( - AutoInstall.method(:callbackTrue_boolean_string_integer), - "boolean (string, integer)" - ) - ) - - tmpdir = Convert.to_string(SCR.Read(path(".target.tmpdir"))) - - mainRepo = AutoinstSoftware.instsource - contents = VBox( - HBox( - VBox( - TextEntry( - Id(:location), - Opt(:notify), - _( - "Location of the installation source (like http://myhost/11.3/DVD1/)" - ), - mainRepo - ), - CheckBox( - Id(:localSource), - Opt(:notify), - _( - "The inst-source of this system (you can't create images if you choose this)" - ), - mainRepo == "" - ) - ) - ), - HBox(PushButton(Id(:ok), Label.OKButton), PushButton(Id(:abort), Label.AbortButton)) - ) - UI.OpenDialog(Opt(:decorated), contents) - UI.ChangeWidget(Id(:location), :Enabled, mainRepo != "") - okay = false - begin - ret = nil - if Ops.greater_than( - Builtins.size( - Convert.to_string(UI.QueryWidget(Id(:location), :Value)) - ), - 0 - ) - UI.ChangeWidget(Id(:localSource), :Enabled, false) - else - UI.ChangeWidget(Id(:localSource), :Enabled, true) - end - ret = UI.UserInput - if ret == :ok - if Convert.to_boolean(UI.QueryWidget(Id(:localSource), :Value)) - Pkg.TargetInit("/", false) - okay = true - else - Pkg.SourceFinishAll - mainRepo = Convert.to_string(UI.QueryWidget(Id(:location), :Value)) - Pkg.TargetInit(tmpdir, false) - if SourceManager.createSource(mainRepo) == :ok - okay = true - else - Popup.Error(_("using that installation source failed")) - end - end - elsif ret == :abort - UI.CloseDialog - return :back - elsif ret == :localSource - localSource = Convert.to_boolean( - UI.QueryWidget(Id(:localSource), :Value) - ) - UI.ChangeWidget(Id(:location), :Enabled, !localSource) - UI.ChangeWidget(Id(:location), :Value, "") if localSource - end - end while !okay - UI.CloseDialog - AutoinstSoftware.instsource = mainRepo - - Pkg.SourceStartManager(true) - - Wizard.CreateDialog - Wizard.SetDesktopIcon("software") - - Wizard.SetContents( - title, - HVCenter(Label(_("Reading package database..."))), - helptext, - false, - true - ) - patterns = Y2Packager::Resolvable.find(kind: :pattern) - Builtins.y2milestone("available patterns %1", patterns) - # sort available_base_selections by order - # $[ "order" : [ "name", "summary" ], .... ] - - if patterns != [] - @ret = :again - Pkg.PkgReset - Builtins.foreach(AutoinstSoftware.patterns) do |pattern| - Pkg.ResolvableInstall(pattern, :pattern) - end - - if Ops.greater_than(Builtins.size(PackageAI.toinstall), 0) - Builtins.foreach(PackageAI.toinstall) do |p| - Builtins.y2milestone( - "selecting package for installation: %1 -> %2", - p, - Pkg.PkgInstall(p) - ) - end - end - if Ops.greater_than(Builtins.size(PackageAI.toremove), 0) - Builtins.foreach(PackageAI.toremove) do |p| - Builtins.y2milestone( - "deselecting package for installation: %1 -> %2", - p, - Pkg.PkgTaboo(p) - ) - end - end - while @ret == :again - @ret = PackagesUI.RunPackageSelector("mode" => :searchMode) - - @ret = :next if @ret == :accept - end - end - allpacs = Pkg.GetPackages(:selected, true) - Builtins.y2milestone( - "All packages: %1 ( %2 )", - allpacs, - Builtins.size(allpacs) - ) - - patadd = [] - if @ret != :back - all_patterns = Y2Packager::Resolvable.find( - kind: :pattern, status: :selected - ).map(&:name) - Builtins.y2milestone( - "available patterns %1", all_patterns - ) - patadd = all_patterns - else - patadd = deep_copy(AutoinstSoftware.patterns) - end - - PackageAI.toinstall = Pkg.FilterPackages(false, true, true, true) - PackageAI.toremove = Pkg.GetPackages(:taboo, true) - AutoinstSoftware.patterns = Convert.convert( - Builtins.union(patadd, patadd), - from: "list", - to: "list <string>" - ) # FIXME: why are there double entries sometimes? - - Wizard.CloseDialog - Convert.to_symbol(@ret) - end - end -end - -Yast::SoftwareAutoClient.new.main +require "autoinstall/clients/software_auto" +Y2Autoinstallation::Clients::SoftwareAuto.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/src/lib/autoinstall/clients/software_auto.rb new/autoyast2-4.4.24/src/lib/autoinstall/clients/software_auto.rb --- old/autoyast2-4.4.23/src/lib/autoinstall/clients/software_auto.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/autoyast2-4.4.24/src/lib/autoinstall/clients/software_auto.rb 2021-12-17 11:55:13.000000000 +0100 @@ -0,0 +1,273 @@ +# Copyright (c) [2021] 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" +require "y2packager/resolvable" + +module Y2Autoinstallation + module Clients + class SoftwareAuto < Yast::Client + def main + Yast.import "Pkg" + Yast.import "UI" + + textdomain "autoinst" + + Yast.import "Wizard" + Yast.import "Summary" + Yast.import "Report" + Yast.import "AutoinstConfig" + Yast.import "AutoinstSoftware" + Yast.import "Label" + Yast.import "PackageAI" + Yast.import "AutoInstall" + Yast.import "SourceManager" + Yast.import "PackagesUI" + Yast.import "Popup" + + Yast.include self, "autoinstall/dialogs.rb" + + @ret = nil + @func = "" + @param = {} + + # Check arguments + if Yast::Ops.greater_than(Yast::Builtins.size(WFM.Args), 0) && + Yast::Ops.is_string?(WFM.Args(0)) + @func = Yast::Convert.to_string(WFM.Args(0)) + if Yast::Ops.greater_than(Yast::Builtins.size(WFM.Args), 1) && + Yast::Ops.is_map?(WFM.Args(1)) + @param = Yast::Convert.to_map(WFM.Args(1)) + end + end + Yast::Builtins.y2debug("func=%1", @func) + Yast::Builtins.y2debug("param=%1", @param) + + # create a summary + + if @func == "Summary" + @ret = Yast::AutoinstSoftware.Summary + elsif @func == "Import" + @ret = Yast::AutoinstSoftware.Import(@param) + elsif @func == "Read" + # use the previously saved software selection if defined (bsc#956325) + @ret = Yast::AutoinstSoftware.SavedPackageSelection || Yast::AutoinstSoftware.Read + elsif @func == "Reset" + Yast::AutoinstSoftware.Import({}) + @ret = {} + elsif @func == "Change" + @ret = packageSelector + elsif @func == "GetModified" + @ret = Yast::AutoinstSoftware.GetModified || Yast::PackageAI.GetModified + elsif @func == "SetModified" + Yast::AutoinstSoftware.SetModified + @ret = true + elsif @func == "Export" + @ret = Yast::AutoinstSoftware.Export + else + Yast::Builtins.y2error("unknown function: %1", @func) + @ret = false + end + + Yast::Builtins.y2debug("ret=%1", @ret) + Yast::Builtins.y2milestone("Software auto finished") + Yast::Builtins.y2milestone("----------------------------------------") + + deep_copy(@ret) + + # Finish + end + + # Select packages + # @return [Symbol] + def packageSelector + title = _("Software Selection") + helptext = _( + "<p>\n" \ + "Select one of the following <b>base</b> selections and click <i>Detailed<i> to add\n" \ + "more <b>add-on</b> selections and packages.\n" \ + "</p>\n" + ) + # Yast::Pkg::TargetFinish (); + Yast::Pkg.CallbackAcceptFileWithoutChecksum( + fun_ref( + Yast::AutoInstall.method(:callbackTrue_boolean_string), + "boolean (string)" + ) + ) + Yast::Pkg.CallbackAcceptUnsignedFile( + fun_ref( + Yast::AutoInstall.method(:callbackTrue_boolean_string_integer), + "boolean (string, integer)" + ) + ) + + tmpdir = Yast::Convert.to_string(SCR.Read(path(".target.tmpdir"))) + + mainRepo = Yast::AutoinstSoftware.instsource + contents = VBox( + HBox( + VBox( + TextEntry( + Id(:location), + Opt(:notify), + _( + "Location of the installation source (like http://myhost/11.3/DVD1/)" + ), + mainRepo + ), + CheckBox( + Id(:localSource), + Opt(:notify), + _( + "The inst-source of this system (you can't create images if you choose this)" + ), + mainRepo == "" + ) + ) + ), + HBox( + PushButton(Id(:ok), Yast::Label.OKButton), + PushButton(Id(:abort), Yast::Label.AbortButton) + ) + ) + UI.OpenDialog(Opt(:decorated), contents) + UI.ChangeWidget(Id(:location), :Enabled, mainRepo != "") + loop do + if Yast::Ops.greater_than( + Yast::Builtins.size( + Yast::Convert.to_string(UI.QueryWidget(Id(:location), :Value)) + ), + 0 + ) + UI.ChangeWidget(Id(:localSource), :Enabled, false) + else + UI.ChangeWidget(Id(:localSource), :Enabled, true) + end + ret = UI.UserInput + if ret == :ok + if Yast::Convert.to_boolean(UI.QueryWidget(Id(:localSource), :Value)) + Yast::Pkg.TargetInit("/", false) + break + else + Yast::Pkg.SourceFinishAll + mainRepo = Yast::Convert.to_string(UI.QueryWidget(Id(:location), :Value)) + Yast::Pkg.TargetInit(tmpdir, false) + if Yast::SourceManager.createSource(mainRepo) == :ok + break + else + Yast::Popup.Error(_("using that installation source failed")) + end + end + elsif ret == :abort + UI.CloseDialog + return :back + elsif ret == :localSource + localSource = Yast::Convert.to_boolean( + UI.QueryWidget(Id(:localSource), :Value) + ) + UI.ChangeWidget(Id(:location), :Enabled, !localSource) + UI.ChangeWidget(Id(:location), :Value, "") if localSource + end + end + UI.CloseDialog + Yast::AutoinstSoftware.instsource = mainRepo + + Yast::Pkg.SourceStartManager(true) + + Yast::Wizard.CreateDialog + Yast::Wizard.SetDesktopIcon("software") + + Yast::Wizard.SetContents( + title, + HVCenter(Label(_("Reading package database..."))), + helptext, + false, + true + ) + patterns = Y2Packager::Resolvable.find(kind: :pattern) + Yast::Builtins.y2milestone("available patterns %1", patterns) + # sort available_base_selections by order + # $[ "order" : [ "name", "summary" ], .... ] + + if patterns != [] + @ret = :again + Yast::Pkg.PkgReset + Yast::Builtins.foreach(Yast::AutoinstSoftware.patterns) do |pattern| + Yast::Pkg.ResolvableInstall(pattern, :pattern) + end + + if Yast::Ops.greater_than(Yast::Builtins.size(Yast::PackageAI.toinstall), 0) + Yast::Builtins.foreach(Yast::PackageAI.toinstall) do |p| + Yast::Builtins.y2milestone( + "selecting package for installation: %1 -> %2", + p, + Yast::Pkg.PkgInstall(p) + ) + end + end + if Yast::Ops.greater_than(Yast::Builtins.size(Yast::PackageAI.toremove), 0) + Yast::Builtins.foreach(Yast::PackageAI.toremove) do |p| + Yast::Builtins.y2milestone( + "deselecting package for installation: %1 -> %2", + p, + Yast::Pkg.PkgTaboo(p) + ) + end + end + while @ret == :again + @ret = Yast::PackagesUI.RunPackageSelector("mode" => :searchMode) + + @ret = :next if @ret == :accept + end + end + allpacs = Yast::Pkg.GetPackages(:selected, true) + Yast::Builtins.y2milestone( + "All packages: %1 ( %2 )", + allpacs, + Yast::Builtins.size(allpacs) + ) + + patadd = [] + if @ret != :back + all_patterns = Y2Packager::Resolvable.find( + kind: :pattern, status: :selected + ).map(&:name) + Yast::Builtins.y2milestone( + "available patterns %1", all_patterns + ) + patadd = all_patterns + else + patadd = deep_copy(Yast::AutoinstSoftware.patterns) + end + + Yast::PackageAI.toinstall = Yast::Pkg.FilterPackages(false, true, true, true) + Yast::PackageAI.toremove = Yast::Pkg.GetPackages(:taboo, true) + Yast::AutoinstSoftware.patterns = Yast::Convert.convert( + Yast::Builtins.union(patadd, patadd), + from: "list", + to: "list <string>" + ) # FIXME: why are there double entries sometimes? + + Yast::Wizard.CloseDialog + Yast::Convert.to_symbol(@ret) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/src/lib/autoinstall/efi_detector.rb new/autoyast2-4.4.24/src/lib/autoinstall/efi_detector.rb --- old/autoyast2-4.4.23/src/lib/autoinstall/efi_detector.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/src/lib/autoinstall/efi_detector.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,23 +0,0 @@ -Yast.import "Linuxrc" -Yast.import "Stage" - -module Y2Autoinstallation - # This class is responsible of detecting if the system was booted using EFI or not - class EFIDetector - EFI_VARS_DIRS = ["/sys/firmware/efi/efivars", "/sys/firmware/efi/vars/"].freeze - - # Returns whether the system was booted using UEFI or not - # - # During the First Stage of the installation it relies on linuxrc for detecting the boot - # but in the rest of cases it checks if any of the EFI vars directories exist - # - # @return [Boolean] whether the system was booted using UEFI or not - def self.boot_efi? - if Yast::Stage.initial - Yast::Linuxrc.InstallInf("EFI") == "1" - else - EFI_VARS_DIRS.any? { |d| Dir.exist?(d) } - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/src/lib/autoinstall/y2erb.rb new/autoyast2-4.4.24/src/lib/autoinstall/y2erb.rb --- old/autoyast2-4.4.23/src/lib/autoinstall/y2erb.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/src/lib/autoinstall/y2erb.rb 2021-12-17 11:55:13.000000000 +0100 @@ -1,6 +1,6 @@ require "yast" require "erb" -require "autoinstall/efi_detector" +require "y2storage" module Y2Autoinstallation class Y2ERB @@ -13,10 +13,9 @@ class TemplateEnvironment include Yast::Logger - # @see Y2Autoinstallation::EFIDetector # @return [Boolean] whether the system is booted using EFI or not def boot_efi? - EFIDetector.boot_efi? + Y2Storage::Arch.new.efiboot? end def hardware diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/src/modules/AutoInstallRules.rb new/autoyast2-4.4.24/src/modules/AutoInstallRules.rb --- old/autoyast2-4.4.23/src/modules/AutoInstallRules.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/src/modules/AutoInstallRules.rb 2021-12-17 11:55:13.000000000 +0100 @@ -6,7 +6,6 @@ # $Id$ require "yast" require "autoinstall/xml_checks" -require "autoinstall/efi_detector" require "yast2/popup" require "y2storage" @@ -1086,10 +1085,9 @@ nil end - # @see Y2Autoinstallation::EFIDetector # @return [String] "yes" when the system is booted using EFI or "no" when not def boot_efi? - Y2Autoinstallation::EFIDetector.boot_efi? ? "yes" : "no" + Y2Storage::Arch.new.efiboot? ? "yes" : "no" end # Regexp to extract the IP from the routes table diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/test/AutoInstallRules_test.rb new/autoyast2-4.4.24/test/AutoInstallRules_test.rb --- old/autoyast2-4.4.23/test/AutoInstallRules_test.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/test/AutoInstallRules_test.rb 2021-12-17 11:55:13.000000000 +0100 @@ -29,6 +29,7 @@ end it "detect system properties" do + allow_any_instance_of(Y2Storage::Arch).to receive(:efiboot?).and_return(true) allow(Y2Storage::StorageManager.instance).to receive(:probed) .and_return(devicegraph) allow(Y2Storage::StorageManager.instance.probed).to receive(:disks) @@ -43,7 +44,6 @@ expect(Yast::Kernel).to receive(:GetPackages).and_return([]) expect(subject).to receive(:getNetwork).and_return("192.168.1.0") expect(subject).to receive(:getHostname).and_return("myhost") - expect(Y2Autoinstallation::EFIDetector).to receive(:boot_efi?).and_return(true) expect(Yast::SCR).to receive(:Read).with(Yast::Path.new(".etc.install_inf.XServer")) expect(Yast::Hostname).to receive(:CurrentDomain).and_return("mydomain.lan") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/test/lib/clients/software_auto_test.rb new/autoyast2-4.4.24/test/lib/clients/software_auto_test.rb --- old/autoyast2-4.4.23/test/lib/clients/software_auto_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/autoyast2-4.4.24/test/lib/clients/software_auto_test.rb 2021-12-17 11:55:13.000000000 +0100 @@ -0,0 +1,239 @@ +# Copyright (c) [2021] 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 "autoinstall/clients/software_auto" +Yast.import "AutoinstSoftware" + +describe Y2Autoinstallation::Clients::SoftwareAuto do + subject(:client) do + described_class.new + end + + before do + Yast::AutoinstSoftware.main + Yast::PackageAI.main + end + + describe "#main" do + let(:args) { [] } + + before do + allow(Yast::WFM).to receive(:Args) do |n| + n ? args[n] : args + end + end + + describe "'Summary' command" do + let(:args) { ["Summary"] } + + it "returns the summary from the AutoinstSoftware module" do + allow(Yast::AutoinstSoftware).to receive(:Summary).and_return("packages summary") + expect(client.main).to eq("packages summary") + end + end + + describe "'Import' command" do + let(:args) { ["Import", { "packages" => [] }] } + + it "imports the configuration into the AutoinstSoftware module" do + expect(Yast::AutoinstSoftware).to receive(:Import).with(args[1]) + client.main + end + end + + describe "'Reset' command" do + let(:args) { ["Reset"] } + + it "imports an empty configuration into the AutoinstSoftware module" do + expect(Yast::AutoinstSoftware).to receive(:Import).with({}) + client.main + end + end + + describe "'Read' command" do + let(:args) { ["Read"] } + + context "when a previously saved software selection exists" do + it "reads the saved selection" do + expect(Yast::AutoinstSoftware).to receive(:SavedPackageSelection).and_return(true) + expect(Yast::AutoinstSoftware).to_not receive(:Read) + expect(client.main).to eq(true) + end + end + + context "when no previously saved software selection exists" do + before do + allow(Yast::AutoinstSoftware).to receive(:SavedPackageSelection).and_return(false) + end + + it "reads the saved selection" do + expect(Yast::AutoinstSoftware).to receive(:Read).and_return(true) + expect(client.main).to eq(true) + end + end + end + + describe "'Change' command" do + let(:args) { ["Change"] } + let(:local_source) { true } + let(:base_pattern) { double(Y2Packager::Resolvable, name: "base") } + let(:yast2_pattern) { double(Y2Packager::Resolvable, name: "yast2_basis") } + let(:selected_patterns) { [base_pattern] } + + before do + allow(Yast::UI).to receive(:QueryWidget).with(Id(:location), :Value) + .and_return(!local_source) + allow(Yast::UI).to receive(:QueryWidget).with(Id(:localSource), :Value) + .and_return(local_source) + allow(Yast::UI).to receive(:UserInput).and_return(:ok) + allow(Yast::Pkg).to receive(:SourceStartManager) + allow(Yast::PackagesUI).to receive(:RunPackageSelector).and_return(:next) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :pattern) + .and_return([base_pattern]) + allow(Y2Packager::Resolvable).to receive(:find).with(kind: :pattern, status: :selected) + .and_return(selected_patterns) + end + + it "displays a dialog to select the location of the installation source" + + context "when a pattern is preselected for installation" do + before do + Yast::AutoinstSoftware.patterns = ["base"] + end + + it "selects the patterns" do + expect(Yast::Pkg).to receive(:ResolvableInstall).with("base", :pattern) + client.main + end + end + + context "when the packages proposal includes packages to install" do + before do + Yast::PackageAI.toinstall = ["yast2"] + end + + it "selects the packages" do + expect(Yast::Pkg).to receive(:PkgInstall).with("yast2") + client.main + end + end + + context "when the packages proposal includes packages to remove" do + before do + Yast::PackageAI.toremove = ["dummy"] + end + + it "deselects the packages" do + expect(Yast::Pkg).to receive(:PkgTaboo).with("dummy") + client.main + end + end + + it "starts the package manager" do + expect(Yast::Pkg).to receive(:SourceStartManager) + expect(Yast::PackagesUI).to receive(:RunPackageSelector).with("mode" => :searchMode) + .and_return(:next) + client.main + end + + context "when patterns and/or packages are selected/deselected" do + let(:selected_patterns) { [base_pattern, yast2_pattern] } + let(:selected_packages) { [{ "name" => "yast2" }, { "name" => "git" }] } + let(:removed_packages) { ["dummy"] } + + before do + allow(Yast::Pkg).to receive(:FilterPackages).with(false, true, true, true) do + selected_packages.map { |pkg| pkg["name"] } + end + allow(Yast::Pkg).to receive(:GetPackages).with(:selected, true) + .and_return(selected_packages) + allow(Yast::Pkg).to receive(:GetPackages).with(:taboo, true) + .and_return(removed_packages) + end + + it "updates the proposal and the list of patterns" do + client.main + expect(Yast::AutoinstSoftware.patterns).to eq([base_pattern.name, yast2_pattern.name]) + expect(Yast::PackageAI.toinstall).to eq(["yast2", "git"]) + expect(Yast::PackageAI.toremove).to eq(["dummy"]) + end + end + + it "initializes the pkg target to the root filesystem" do + expect(Yast::Pkg).to receive(:TargetInit).with("/", false) + client.main + end + + context "when the inst-source of the system is selected" do + let(:local_source) { false } + + it "adds the given repository" + end + end + + describe "'SetModified' command" do + let(:args) { ["SetModified"] } + + it "sets the AutoinstSoftware module as modified" do + expect { client.main }.to change { Yast::AutoinstSoftware.GetModified } + .from(false).to(true) + end + end + + describe "'GetModified'" do + let(:args) { ["GetModified"] } + + context "when the AutoinstSoftware module is modified" do + before do + Yast::AutoinstSoftware.SetModified + end + + it "returns true" do + expect(client.main).to eq(true) + end + end + + context "when the PackageAI module is modified" do + before do + Yast::PackageAI.SetModified + end + + it "returns true" do + expect(client.main).to eq(true) + end + end + + context "when AutoinstSofware and PackageAI are not modified" do + it "returns false" do + expect(client.main).to eq(false) + end + end + end + + describe "'Export' command" do + let(:args) { ["Export"] } + + it "returns the export from the AutoinstSoftware module" do + allow(Yast::AutoinstSoftware).to receive(:Export).and_return({}) + expect(client.main).to eq({}) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/test/lib/efi_detector_test.rb new/autoyast2-4.4.24/test/lib/efi_detector_test.rb --- old/autoyast2-4.4.23/test/lib/efi_detector_test.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/test/lib/efi_detector_test.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -require_relative "../test_helper" -require "autoinstall/efi_detector" - -describe Y2Autoinstallation::EFIDetector do - describe ".boot_efi?" do - let(:efi) { true } - - context "when called in the initial Stage" do - before do - allow(Yast::Linuxrc).to receive(:InstallInf).with("EFI").and_return(efi) - end - - context "and EFI is read as '1' from the Install.inf file" do - it "returns true" do - expect(described_class.boot_efi?) - end - end - - context "and EFI is not read as '1' from the Install.inf file" do - let(:efi) { false } - - it "returns false" do - expect(described_class.boot_efi?) - end - end - end - - context "when called in normal Mode" do - before do - allow(Dir).to receive(:exist?) - end - - described_class.const_get("EFI_VARS_DIRS").each do |dir| - it "returns true if '#{dir}' exists" do - expect(Dir).to receive(:exist?).with(dir).and_return(true) - expect(described_class.boot_efi?).to eq(true) - end - end - - it "returns false otherwise" do - described_class.const_get("EFI_VARS_DIRS").each do |dir| - allow(Dir).to receive(:exist?).with(dir).and_return(false) - end - - expect(described_class.boot_efi?).to eq(false) - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.4.23/test/lib/y2erb_test.rb new/autoyast2-4.4.24/test/lib/y2erb_test.rb --- old/autoyast2-4.4.23/test/lib/y2erb_test.rb 2021-11-25 19:08:03.000000000 +0100 +++ new/autoyast2-4.4.24/test/lib/y2erb_test.rb 2021-12-17 11:55:13.000000000 +0100 @@ -216,7 +216,7 @@ let(:efi) { true } before do - allow(Y2Autoinstallation::EFIDetector).to receive(:boot_efi?).and_return(efi) + allow_any_instance_of(Y2Storage::Arch).to receive(:efiboot?).and_return(efi) end context "when the system was booted with EFI" do