Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-bootloader for openSUSE:Factory checked in at 2021-07-09 23:56:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old) and /work/SRC/openSUSE:Factory/.yast2-bootloader.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-bootloader" Fri Jul 9 23:56:46 2021 rev:310 rq:904568 version:4.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes 2021-07-04 22:10:14.873458777 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new.2625/yast2-bootloader.changes 2021-07-09 23:57:06.561564977 +0200 @@ -1,0 +2,8 @@ +Wed Jul 7 09:22:03 UTC 2021 - Stefan Hundhammer <shundham...@suse.com> + +- Add the os-prober package to the set of packages to install + if the package is available and supported on the arch + (bsc#1186369) +- 4.4.5 + +------------------------------------------------------------------- Old: ---- yast2-bootloader-4.4.4.tar.bz2 New: ---- yast2-bootloader-4.4.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-bootloader.spec ++++++ --- /var/tmp/diff_new_pack.PRvK78/_old 2021-07-09 23:57:07.045561213 +0200 +++ /var/tmp/diff_new_pack.PRvK78/_new 2021-07-09 23:57:07.045561213 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 4.4.4 +Version: 4.4.5 Release: 0 Summary: YaST2 - Bootloader Configuration License: GPL-2.0-or-later ++++++ yast2-bootloader-4.4.4.tar.bz2 -> yast2-bootloader-4.4.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/package/yast2-bootloader.changes new/yast2-bootloader-4.4.5/package/yast2-bootloader.changes --- old/yast2-bootloader-4.4.4/package/yast2-bootloader.changes 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/package/yast2-bootloader.changes 2021-07-07 11:58:27.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Jul 7 09:22:03 UTC 2021 - Stefan Hundhammer <shundham...@suse.com> + +- Add the os-prober package to the set of packages to install + if the package is available and supported on the arch + (bsc#1186369) +- 4.4.5 + +------------------------------------------------------------------- Fri Jun 18 07:28:57 UTC 2021 - Dirk M??ller <dmuel...@suse.com> - add riscv64 support (jsc#PM-2612) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/package/yast2-bootloader.spec new/yast2-bootloader-4.4.5/package/yast2-bootloader.spec --- old/yast2-bootloader-4.4.4/package/yast2-bootloader.spec 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/package/yast2-bootloader.spec 2021-07-07 11:58:27.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 4.4.4 +Version: 4.4.5 Release: 0 Summary: YaST2 - Bootloader Configuration License: GPL-2.0-or-later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/src/lib/bootloader/grub2_widgets.rb new/yast2-bootloader-4.4.5/src/lib/bootloader/grub2_widgets.rb --- old/yast2-bootloader-4.4.4/src/lib/bootloader/grub2_widgets.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/src/lib/bootloader/grub2_widgets.rb 2021-07-07 11:58:27.000000000 +0200 @@ -7,6 +7,7 @@ require "bootloader/serial_console" require "bootloader/cpu_mitigations" require "bootloader/systeminfo" +require "bootloader/os_prober" require "cfa/matcher" Yast.import "BootStorage" @@ -1103,7 +1104,7 @@ TimeoutWidget.new(hiden_menu_widget), HSpacing(1), VBox( - Left(Yast::Arch.s390 ? CWM::Empty.new("os_prober") : OSProberWidget.new), + os_prober_widget, VSpacing(1), Left(hiden_menu_widget) ), @@ -1115,5 +1116,15 @@ VStretch() ) end + + private + + def os_prober_widget + if OsProber.available? # Checks !Arch.s390 and if package is available + Left(OSProberWidget.new) + else + CWM::Empty.new("os_prober") + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/src/lib/bootloader/grub2base.rb new/yast2-bootloader-4.4.5/src/lib/bootloader/grub2base.rb --- old/yast2-bootloader-4.4.4/src/lib/bootloader/grub2base.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/src/lib/bootloader/grub2base.rb 2021-07-07 11:58:27.000000000 +0200 @@ -10,6 +10,7 @@ require "bootloader/udev_mapping" require "bootloader/serial_console" require "bootloader/language" +require "bootloader/os_prober" require "cfa/grub2/default" require "cfa/grub2/grub_cfg" require "cfa/matcher" @@ -184,6 +185,23 @@ self.update_nvram = other.update_nvram unless other.update_nvram.nil? end + def packages + res = super + res << OsProber.package_name if include_os_prober_package? + res + end + + # Checks if the os-prober package should be included. + # + # This default implementation checks if os-prober is supported on the + # current architecture (all except s/390) and if the package is available + # (not all products include it). + # + # @return [Boolean] true if the os-prober package should be included; false otherwise. + def include_os_prober_package? + OsProber.available? + end + def enable_serial_console(console_arg_string) @console = SerialConsole.load_from_console_args(console_arg_string) raise ::Bootloader::InvalidSerialConsoleArguments unless @console diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/src/lib/bootloader/os_prober.rb new/yast2-bootloader-4.4.5/src/lib/bootloader/os_prober.rb --- old/yast2-bootloader-4.4.4/src/lib/bootloader/os_prober.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-bootloader-4.4.5/src/lib/bootloader/os_prober.rb 2021-07-07 11:58:27.000000000 +0200 @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require "yast" + +Yast.import "Package" +Yast.import "Arch" + +module Bootloader + # Helper methods for the os-prober package + class OsProber + class << self + def package_name + "os-prober" + end + + # Check if os-prober is supported on this architecture and if the package + # is available + def available? + arch_supported? && package_available? + end + + # Check if the os-prober package is available for installation + def package_available? + Yast::Package.Available(package_name) + end + + # Check if os-prober is supported on this architecture + def arch_supported? + !Yast::Arch.s390 + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/bootloader/auto_client_test.rb new/yast2-bootloader-4.4.5/test/bootloader/auto_client_test.rb --- old/yast2-bootloader-4.4.4/test/bootloader/auto_client_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/bootloader/auto_client_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -29,6 +29,7 @@ before do allow(Yast::Bootloader).to receive(:Import).and_return(imported) + allow(Yast::Package).to receive(:Available).and_return(true) end it "imports the configuration" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/bootloader_proposal_client_test.rb new/yast2-bootloader-4.4.5/test/bootloader_proposal_client_test.rb --- old/yast2-bootloader-4.4.4/test/bootloader_proposal_client_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/bootloader_proposal_client_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -15,6 +15,7 @@ Bootloader::BootloaderFactory.clear_cache allow(Yast::Bootloader).to receive(:Reset) + allow(Yast::Package).to receive(:Available).and_return(true) end describe "#description" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/bootloader_test.rb new/yast2-bootloader-4.4.5/test/bootloader_test.rb --- old/yast2-bootloader-4.4.4/test/bootloader_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/bootloader_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -29,6 +29,7 @@ before do allow(Yast::PackageSystem).to receive(:InstallAll).and_return(false) allow(Yast2::Popup).to receive(:show) + allow(Yast::Package).to receive(:Available).and_return(true) end it "shows an information message" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/grub2_efi_test.rb new/yast2-bootloader-4.4.5/test/grub2_efi_test.rb --- old/yast2-bootloader-4.4.4/test/grub2_efi_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/grub2_efi_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -18,6 +18,7 @@ allow(Yast::BootStorage).to receive(:available_swap_partitions).and_return([]) allow(Bootloader::GrubInstall).to receive(:new).and_return(double.as_null_object) allow(Yast::Arch).to receive(:architecture).and_return("x86_64") + allow(Yast::Package).to receive(:Available).and_return(true) end describe "#read" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/grub2_test.rb new/yast2-bootloader-4.4.5/test/grub2_test.rb --- old/yast2-bootloader-4.4.4/test/grub2_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/grub2_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -151,6 +151,7 @@ before do allow(Yast::Stage).to receive(:initial).and_return(initial_stage) allow(Bootloader::Stage1).to receive(:new).and_return(stage1) + allow(Yast::Package).to receive(:Available).and_return(true) end it "contains grub2 package" do @@ -214,11 +215,39 @@ allow(subject).to receive(:trusted_boot).and_return(false) end - it "does not contain the trusged grub packages" do + it "does not contain the trusted grub packages" do expect(subject.packages).to_not include("trustedgrub2") expect(subject.packages).to_not include("trustedgrub2-i386-pc") end end + + context "on non-s390 architectures" do + before do + allow(Yast::Arch).to receive(:s390).and_return(false) + end + + context "if the os-prober package is available" do + it "contains the os-prober package" do + expect(subject.packages).to include("os-prober") + end + end + + context "if the os-prober package is not available" do + it "does not contain the os-prober package" do + expect(subject.packages).to include("os-prober") + end + end + end + + context "on the s390 architecture" do + before do + allow(Yast::Arch).to receive(:s390_64).and_return(true) + end + + it "does not contain the os-prober package" do + expect(subject.packages).to_not include("os-prober") + end + end end describe "#summary" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/grub2_widgets_test.rb new/yast2-bootloader-4.4.5/test/grub2_widgets_test.rb --- old/yast2-bootloader-4.4.4/test/grub2_widgets_test.rb 2021-06-23 08:29:45.000000000 +0200 +++ new/yast2-bootloader-4.4.5/test/grub2_widgets_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -818,6 +818,7 @@ describe Bootloader::BootloaderTab do before do + allow(Yast::Package).to receive(:Available).and_return(true) assign_bootloader end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-4.4.4/test/os_prober_test.rb new/yast2-bootloader-4.4.5/test/os_prober_test.rb --- old/yast2-bootloader-4.4.4/test/os_prober_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-bootloader-4.4.5/test/os_prober_test.rb 2021-07-07 11:58:27.000000000 +0200 @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +describe Bootloader::OsProber do + subject = described_class + + describe "#package_name" do + it "Returns the correct package name" do + expect(subject.package_name).to eq "os-prober" + end + end + + describe "#arch_supported?" do + context "on non-s390 architectures" do + before do + allow(Yast::Arch).to receive(:s390).and_return(false) + end + + it "os-prober is supported" do + expect(subject.arch_supported?).to eq true + end + end + + context "on the s390 architecture" do + before do + allow(Yast::Arch).to receive(:s390).and_return(true) + end + + it "os-prober is not supported" do + expect(subject.arch_supported?).to eq false + end + end + end + + describe "#available?" do + context "on non-s390 architectures" do + before do + allow(Yast::Arch).to receive(:s390).and_return(false) + end + + context "if the os-prober package is available" do + before do + allow(Yast::Package).to receive(:Available).and_return(true) + end + + it "os-prober is available" do + expect(subject.available?).to eq true + end + end + + context "if the os-prober package is not available" do + before do + allow(Yast::Package).to receive(:Available).and_return(false) + end + + it "os-prober is not available" do + expect(subject.available?).to eq false + end + end + end + end +end