Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2023-01-10 14:59:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Tue Jan 10 14:59:12 2023 rev:514 rq:1057021 version:4.5.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2022-12-07 17:34:04.812248445 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.32243/yast2-installation.changes
 2023-01-10 14:59:29.305102951 +0100
@@ -1,0 +2,7 @@
+Fri Jan  6 12:33:29 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- yupdate - added suport for patching the D-Installer
+  (bsc#1206927)
+- 4.5.12
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-4.5.11.tar.bz2

New:
----
  yast2-installation-4.5.12.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.hTcHkU/_old  2023-01-10 14:59:29.989106612 +0100
+++ /var/tmp/diff_new_pack.hTcHkU/_new  2023-01-10 14:59:29.993106633 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-installation
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # 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-installation
-Version:        4.5.11
+Version:        4.5.12
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only

++++++ yast2-installation-4.5.11.tar.bz2 -> yast2-installation-4.5.12.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-4.5.11/bin/yupdate 
new/yast2-installation-4.5.12/bin/yupdate
--- old/yast2-installation-4.5.11/bin/yupdate   2022-12-05 11:30:29.000000000 
+0100
+++ new/yast2-installation-4.5.12/bin/yupdate   2023-01-09 10:53:02.000000000 
+0100
@@ -34,8 +34,8 @@
   # version of the script
   class Version
     MAJOR = 0
-    MINOR = 1
-    PATCH = 3
+    MINOR = 2
+    PATCH = 0
 
     STRING = "#{MAJOR}.#{MINOR}.#{PATCH}".freeze
   end
@@ -109,10 +109,16 @@
   # a simple /etc/install.inf parser/writer,
   # we need to disable the YaST self-update feature to avoid conflicts
   class InstallInf
+    PATH = "/etc/install.inf".freeze
+
     attr_reader :path
 
+    def self.exist?(path = PATH)
+      File.exist?(path)
+    end
+
     # read the file
-    def initialize(path = "/etc/install.inf")
+    def initialize(path = PATH)
       @path = path
       @values = File.read(path).lines.map(&:chomp)
     end
@@ -476,7 +482,10 @@
 
       src_dir = File.dirname(rakefile)
       Dir.chdir(src_dir) do
-        `rake install DESTDIR=#{target.shellescape} 2> /dev/null`
+        redir = ENV["VERBOSE"] == "1" ? "" : " > /dev/null 2>&1"
+        unless system("rake install DESTDIR=#{target.shellescape} #{redir}")
+          raise "rake install failed"
+        end
       end
     end
 
@@ -566,8 +575,8 @@
     end
   end
 
-  # inst-sys test
-  class InstSys
+  # inst-sys or live medium test
+  class System
     # check if the script is running in the inst-sys,
     # the script might not work as expected in an installed system
     # and using OverlayFS is potentially dangerous
@@ -575,8 +584,11 @@
       # the inst-sys contains the /.packages.initrd file with a list of 
packages
       return if File.exist?("/.packages.initrd")
 
+      # live medium uses overlay FS for the root
+      return if `mount`.match?(/^\w+ on \/ type overlay/)
+
       # exit immediately if running in an installed system
-      warn "ERROR: This script can only work in the installation system 
(inst-sys)!"
+      warn "ERROR: This script can only work in the installation system 
(inst-sys) or Live medium!"
       exit 1
     end
   end
@@ -590,10 +602,10 @@
       when "version"
         VersionCommand.new
       when "overlay"
-        InstSys.check!
+        System.check!
         OverlayCommand.new(argv)
       when "patch"
-        InstSys.check!
+        System.check!
         PatchCommand.new(argv)
       when "servers"
         ServersCommand.new(argv)
@@ -700,10 +712,29 @@
       g.install_required_gems
     end
 
+    def run_pre_script(download_dir)
+      script = File.join(download_dir, ".yupdate.pre")
+      run_script(script)
+    end
+
+    def run_post_script(download_dir)
+      script = File.join(download_dir, ".yupdate.post")
+      run_script(script)
+    end
+
+    def run_script(script)
+      return unless File.exist?(script)
+
+      puts "Running script #{File.basename(script)}..."
+      raise "Script #{File.basename(script)} failed" unless system(script)
+    end
+
     def install_tar(downloader)
       Dir.mktmpdir do |download_dir|
         downloader.extract_to(download_dir)
+        run_pre_script(download_dir)
         install_sources(download_dir)
+        run_post_script(download_dir)
       end
     end
 
@@ -712,6 +743,8 @@
 
     # disable the self update in the install.inf file
     def disable_self_update
+      return unless InstallInf.exist?
+
       inf = InstallInf.new
       return if inf[SELF_UPDATE_KEY] == "0"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-4.5.11/doc/yupdate.md 
new/yast2-installation-4.5.12/doc/yupdate.md
--- old/yast2-installation-4.5.11/doc/yupdate.md        2022-12-05 
11:30:29.000000000 +0100
+++ new/yast2-installation-4.5.12/doc/yupdate.md        2023-01-09 
10:53:02.000000000 +0100
@@ -223,6 +223,28 @@
   AutoYaST second stage cannot be fixed by `yupdate`, you need to build
   a DUD, see below.
 
+## Hooks
+
+The source code might contain several callback scripts which are executed
+at specific points. The goal is to allow adjusting the target system before
+or after installing new files.
+
+- `.yupdate.pre` - This script is executed *before* installing the package 
(before
+  running `rake install`). It can prepare the system for installation, install
+  required packages.
+- `.yupdate.post` - This script is executed *after* installing the package 
(after
+  running `rake install`). It can activate the changes, restart services.
+
+When a hook script fails then yupdate aborts the update process immediately.
+
+## Environment Variables
+
+The yupdate script uses these environment variables:
+
+- `VERBOSE` - When set to `1` the output of the `rake install` command is
+  displayed in the terminal. By default it is hidden because the output is too
+  long and verbose. Use this option for debugging installation problems.
+
 ## Alternative
 
 1. For all repos, run `rake osc:build`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.11/package/yast2-installation.changes 
new/yast2-installation-4.5.12/package/yast2-installation.changes
--- old/yast2-installation-4.5.11/package/yast2-installation.changes    
2022-12-05 11:30:29.000000000 +0100
+++ new/yast2-installation-4.5.12/package/yast2-installation.changes    
2023-01-09 10:53:02.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Jan  6 12:33:29 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- yupdate - added suport for patching the D-Installer
+  (bsc#1206927)
+- 4.5.12
+
+-------------------------------------------------------------------
 Mon Dec  5 10:13:28 UTC 2022 - Stefan Hundhammer <shundham...@suse.com>
 
 - Use default depth for Xvnc, no longer enforce depth 16
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.11/package/yast2-installation.spec 
new/yast2-installation-4.5.12/package/yast2-installation.spec
--- old/yast2-installation-4.5.11/package/yast2-installation.spec       
2022-12-05 11:30:29.000000000 +0100
+++ new/yast2-installation-4.5.12/package/yast2-installation.spec       
2023-01-09 10:53:02.000000000 +0100
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-installation
-Version:        4.5.11
+Version:        4.5.12
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.11/test/yupdate/inst_sys_test.rb 
new/yast2-installation-4.5.12/test/yupdate/inst_sys_test.rb
--- old/yast2-installation-4.5.11/test/yupdate/inst_sys_test.rb 2022-12-05 
11:30:29.000000000 +0100
+++ new/yast2-installation-4.5.12/test/yupdate/inst_sys_test.rb 2023-01-09 
10:53:02.000000000 +0100
@@ -3,9 +3,14 @@
 require_relative "../test_helper"
 require_yupdate
 
-describe YUpdate::InstSys do
+describe YUpdate::System do
   let(:file) { "/.packages.initrd" }
 
+  before do
+    allow(File).to receive(:exist?).with(file).and_return(false)
+    allow(described_class).to receive(:`).with("mount").and_return("")
+  end
+
   describe ".check!" do
     context "when running in an inst-sys" do
       before do
@@ -18,9 +23,20 @@
       end
     end
 
+    context "when running on a live medium" do
+      before do
+        expect(described_class).to receive(:`).with("mount")
+          .and_return("LiveOS_rootfs on / type overlay (rw,relatime)")
+      end
+
+      it "does not exit" do
+        expect(described_class).to_not receive(:exit)
+        described_class.check!
+      end
+    end
+
     context "when running in a normal system" do
       before do
-        expect(File).to receive(:exist?).with(file).and_return(false)
         allow(described_class).to receive(:exit).with(1)
       end
 

Reply via email to