Script 'mail_helper' called by obssrc
Hello community,

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

Package is "yast2-packager"

Sat Jan 14 20:30:41 2023 rev:433 rq:1057785 version:4.5.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2022-12-20 20:20:52.182004099 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new.32243/yast2-packager.changes 
2023-01-14 20:30:46.880881046 +0100
@@ -1,0 +2,10 @@
+Tue Jan 10 17:35:41 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- Media check fixes in containerized environment
+  - Start browsing the ISO files from the /host directory
+    to show the host files (bsc#1206834)
+  - Fixed file readability check to correctly use the specified
+    ISO file
+- 4.5.11
+
+-------------------------------------------------------------------

Old:
----
  yast2-packager-4.5.10.tar.bz2

New:
----
  yast2-packager-4.5.11.tar.bz2

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.YeUICt/_old  2023-01-14 20:30:47.636885511 +0100
+++ /var/tmp/diff_new_pack.YeUICt/_new  2023-01-14 20:30:47.640885535 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-packager
 #
-# 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-packager
-Version:        4.5.10
+Version:        4.5.11
 Release:        0
 Summary:        YaST2 - Package Library
 License:        GPL-2.0-or-later

++++++ yast2-packager-4.5.10.tar.bz2 -> yast2-packager-4.5.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.5.10/package/yast2-packager.changes 
new/yast2-packager-4.5.11/package/yast2-packager.changes
--- old/yast2-packager-4.5.10/package/yast2-packager.changes    2022-12-20 
10:39:29.000000000 +0100
+++ new/yast2-packager-4.5.11/package/yast2-packager.changes    2023-01-11 
14:17:01.000000000 +0100
@@ -1,4 +1,14 @@
 -------------------------------------------------------------------
+Tue Jan 10 17:35:41 UTC 2023 - Ladislav Slezák <lsle...@suse.com>
+
+- Media check fixes in containerized environment
+  - Start browsing the ISO files from the /host directory
+    to show the host files (bsc#1206834)
+  - Fixed file readability check to correctly use the specified
+    ISO file
+- 4.5.11
+
+-------------------------------------------------------------------
 Tue Dec 20 09:30:54 UTC 2022 - Ladislav Slezák <lsle...@suse.com>
 
 - Do not fail when the installation URL contains a space
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.5.10/package/yast2-packager.spec 
new/yast2-packager-4.5.11/package/yast2-packager.spec
--- old/yast2-packager-4.5.10/package/yast2-packager.spec       2022-12-20 
10:39:29.000000000 +0100
+++ new/yast2-packager-4.5.11/package/yast2-packager.spec       2023-01-11 
14:17:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.5.10
+Version:        4.5.11
 Release:        0
 Summary:        YaST2 - Package Library
 License:        GPL-2.0-or-later
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.5.10/src/include/checkmedia/ui.rb 
new/yast2-packager-4.5.11/src/include/checkmedia/ui.rb
--- old/yast2-packager-4.5.10/src/include/checkmedia/ui.rb      2022-12-20 
10:39:29.000000000 +0100
+++ new/yast2-packager-4.5.11/src/include/checkmedia/ui.rb      2023-01-11 
14:17:01.000000000 +0100
@@ -23,6 +23,8 @@
 module Yast
   # All user interface functions.
   module CheckmediaUiInclude
+    include Yast::Logger
+
     def initialize_checkmedia_ui(_include_target)
       Yast.import "Pkg"
       Yast.import "UI"
@@ -42,7 +44,9 @@
       Yast.import "Directory"
 
       # selected input file (used when checking a file instead of physical 
CD/DVD medium)
-      @iso_filename = ""
+      # when running in a container start browsing the files from the host 
root directory,
+      # not from the container root
+      @iso_filename = (ENV["YAST_SCR_TARGET"]).to_s
 
       # checking file (ISO image) instead of a medium is in progress
       @checking_file = false
@@ -426,27 +430,7 @@
               selecteddrive
             )
 
-            # try to read one byte from the medium
-            res = SCR.Execute(
-              path(".target.bash"),
-              "/usr/bin/head -c 1 #{selecteddrive.shellescape} > /dev/null"
-            )
-            if res.nonzero?
-              # TRANSLATORS: error message: the medium cannot be read or no 
medium in the
-              # drive; %1 = drive, e.g. /dev/hdc
-              LogLine(
-                Ops.add(
-                  Ops.add(
-                    "<FONT COLOR=red>",
-                    Builtins.sformat(
-                      _("Cannot read medium in drive %1."),
-                      selecteddrive
-                    )
-                  ),
-                  "</FONT>"
-                )
-              )
-            else
+            if medium_readable?(selecteddrive)
               if !CheckMedia.valid_checksum?(selecteddrive)
                 continue_checking = Popup.ContinueCancel(
                   _("The medium does not contain a valid checksum.\n" \
@@ -509,6 +493,21 @@
                   )
                 )
               end
+            else
+              # TRANSLATORS: error message: the medium cannot be read or no 
medium in the
+              # drive; %1 = drive, e.g. /dev/hdc
+              LogLine(
+                Ops.add(
+                  Ops.add(
+                    "<FONT COLOR=red>",
+                    Builtins.sformat(
+                      _("Cannot read medium in drive %1."),
+                      selecteddrive
+                    )
+                  ),
+                  "</FONT>"
+                )
+              )
             end
 
             # process remaining output
@@ -555,6 +554,17 @@
       ret
     end
 
+    # try to read one byte from the medium to check whether it is readable
+    # @param file [String] file path
+    # @return [Boolean] returns `true` if the file is readable, `false` 
otherwise
+    def medium_readable?(file)
+      File.read(file, 1)
+      true
+    rescue StandardError => e
+      log.info("Cannot read #{file}: #{e}")
+      false
+    end
+
     # Main workflow of the idedma configuration
     # @return [Object] Result from WizardSequencer() function
     def MainSequence

Reply via email to