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-14 00:02:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Sat Jan 14 00:02:13 2023 rev:515 rq:1057929 version:4.5.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2023-01-10 14:59:29.305102951 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.32243/yast2-installation.changes
 2023-01-14 00:02:19.881401119 +0100
@@ -1,0 +2,6 @@
+Thu Jan 12 07:42:55 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- yupdate - added suport for patching containers (bsc#1207069)
+- 4.5.13
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.7GgYhc/_old  2023-01-14 00:02:20.697405872 +0100
+++ /var/tmp/diff_new_pack.7GgYhc/_new  2023-01-14 00:02:20.701405895 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        4.5.12
+Version:        4.5.13
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only

++++++ yast2-installation-4.5.12.tar.bz2 -> yast2-installation-4.5.13.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-4.5.12/bin/yupdate 
new/yast2-installation-4.5.13/bin/yupdate
--- old/yast2-installation-4.5.12/bin/yupdate   2023-01-09 10:53:02.000000000 
+0100
+++ new/yast2-installation-4.5.13/bin/yupdate   2023-01-12 09:34:19.000000000 
+0100
@@ -35,7 +35,7 @@
   class Version
     MAJOR = 0
     MINOR = 2
-    PATCH = 0
+    PATCH = 1
 
     STRING = "#{MAJOR}.#{MINOR}.#{PATCH}".freeze
   end
@@ -575,9 +575,9 @@
     end
   end
 
-  # inst-sys or live medium test
+  # inst-sys, live medium or container test
   class System
-    # check if the script is running in the inst-sys,
+    # check if the script is running in the inst-sys, live medium or in a 
container
     # the script might not work as expected in an installed system
     # and using OverlayFS is potentially dangerous
     def self.check!
@@ -587,10 +587,34 @@
       # live medium uses overlay FS for the root
       return if `mount`.match?(/^\w+ on \/ type overlay/)
 
+      return if in_container?
+
       # exit immediately if running in an installed system
-      warn "ERROR: This script can only work in the installation system 
(inst-sys) or Live medium!"
+      warn "ERROR: This script can only work in the installation system 
(inst-sys), " \
+           "live medium or in a container!"
       exit 1
     end
+
+    # Check whether running in a container.
+    # @return [Boolean] `true` if running inside a container, `false` otherwise
+    def self.in_container?
+      # use the systemd-detect-virt tool for container detection
+      detected = `systemd-detect-virt --container`.chomp
+
+      # the variable contains the detected system, like "docker" or "podman"
+      # see "man systemd-detect-virt" for details
+      !detected.empty? && detected != "none"
+    # systemd-detect-virt tool not present
+    rescue Errno::ENOENT
+      # fallback to detection by special files, this is less reliable
+      # (the files might be removed in the future) and does not
+      # support all container virtualizations
+
+      # docker or podman environment
+      File.exist?("/.dockerenv") || File.exist?("/run/.containerenv")
+    end
+
+    private_class_method :in_container?
   end
 
   # parse the command line options
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.12/package/yast2-installation.changes 
new/yast2-installation-4.5.13/package/yast2-installation.changes
--- old/yast2-installation-4.5.12/package/yast2-installation.changes    
2023-01-09 10:53:02.000000000 +0100
+++ new/yast2-installation-4.5.13/package/yast2-installation.changes    
2023-01-12 09:34:19.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Thu Jan 12 07:42:55 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- yupdate - added suport for patching containers (bsc#1207069)
+- 4.5.13
+
+-------------------------------------------------------------------
 Fri Jan  6 12:33:29 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
 
 - yupdate - added suport for patching the D-Installer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.12/package/yast2-installation.spec 
new/yast2-installation-4.5.13/package/yast2-installation.spec
--- old/yast2-installation-4.5.12/package/yast2-installation.spec       
2023-01-09 10:53:02.000000000 +0100
+++ new/yast2-installation-4.5.13/package/yast2-installation.spec       
2023-01-12 09:34:19.000000000 +0100
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-installation
-Version:        4.5.12
+Version:        4.5.13
 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.12/test/yupdate/inst_sys_test.rb 
new/yast2-installation-4.5.13/test/yupdate/inst_sys_test.rb
--- old/yast2-installation-4.5.12/test/yupdate/inst_sys_test.rb 2023-01-09 
10:53:02.000000000 +0100
+++ new/yast2-installation-4.5.13/test/yupdate/inst_sys_test.rb 1970-01-01 
01:00:00.000000000 +0100
@@ -1,55 +0,0 @@
-#! /usr/bin/env rspec
-
-require_relative "../test_helper"
-require_yupdate
-
-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
-        expect(File).to receive(:exist?).with(file).and_return(true)
-      end
-
-      it "does not exit" do
-        expect(described_class).to_not receive(:exit)
-        described_class.check!
-      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
-        allow(described_class).to receive(:exit).with(1)
-      end
-
-      it "exits with status 1" do
-        expect(described_class).to receive(:exit).with(1)
-        # capture the std streams just to not break the rspec output
-        capture_stdio { described_class.check! }
-      end
-
-      it "prints an error on STDERR" do
-        _stdout, stderr = capture_stdio { described_class.check! }
-        expect(stderr).to match(/ERROR: .*inst-sys/)
-      end
-    end
-  end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.5.12/test/yupdate/system_test.rb 
new/yast2-installation-4.5.13/test/yupdate/system_test.rb
--- old/yast2-installation-4.5.12/test/yupdate/system_test.rb   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-installation-4.5.13/test/yupdate/system_test.rb   2023-01-12 
09:34:19.000000000 +0100
@@ -0,0 +1,56 @@
+#! /usr/bin/env rspec
+
+require_relative "../test_helper"
+require_yupdate
+
+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("")
+    allow(described_class).to receive(:`).with("systemd-detect-virt 
--container").and_return("")
+  end
+
+  describe ".check!" do
+    context "when running in an inst-sys" do
+      before do
+        expect(File).to receive(:exist?).with(file).and_return(true)
+      end
+
+      it "does not exit" do
+        expect(described_class).to_not receive(:exit)
+        described_class.check!
+      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
+        allow(described_class).to receive(:exit).with(1)
+      end
+
+      it "exits with status 1" do
+        expect(described_class).to receive(:exit).with(1)
+        # capture the std streams just to not break the rspec output
+        capture_stdio { described_class.check! }
+      end
+
+      it "prints an error on STDERR" do
+        _stdout, stderr = capture_stdio { described_class.check! }
+        expect(stderr).to start_with("ERROR: This script can only work")
+      end
+    end
+  end
+end

Reply via email to