Hello community,

here is the log from the commit of package yast2-ruby-bindings for 
openSUSE:Factory checked in at 2019-12-11 12:03:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-ruby-bindings"

Wed Dec 11 12:03:04 2019 rev:98 rq:754651 version:4.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes  
2019-11-20 10:25:36.990542904 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new.4691/yast2-ruby-bindings.changes
        2019-12-11 12:03:46.616774380 +0100
@@ -1,0 +2,8 @@
+Thu Dec  5 10:37:29 CET 2019 - [email protected]
+
+- S390: Evaluating an architecture specific string which will be
+  shown in the title bar (ncurses) or in the banner (qt)
+  (jsc#SLE-9424).
+- 4.2.5
+
+-------------------------------------------------------------------

Old:
----
  yast2-ruby-bindings-4.2.4.tar.bz2

New:
----
  yast2-ruby-bindings-4.2.5.tar.bz2

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

Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.LFpIzA/_old  2019-12-11 12:03:47.088774182 +0100
+++ /var/tmp/diff_new_pack.LFpIzA/_new  2019-12-11 12:03:47.088774182 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        4.2.4
+Version:        4.2.5
 Release:        0
 Url:            https://github.com/yast/yast-ruby-bindings
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-ruby-bindings-4.2.4.tar.bz2 -> yast2-ruby-bindings-4.2.5.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.2.4/package/yast2-ruby-bindings.changes 
new/yast2-ruby-bindings-4.2.5/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-4.2.4/package/yast2-ruby-bindings.changes   
2019-11-06 12:41:30.000000000 +0100
+++ new/yast2-ruby-bindings-4.2.5/package/yast2-ruby-bindings.changes   
2019-12-06 11:56:45.000000000 +0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Thu Dec  5 10:37:29 CET 2019 - [email protected]
+
+- S390: Evaluating an architecture specific string which will be
+  shown in the title bar (ncurses) or in the banner (qt)
+  (jsc#SLE-9424).
+- 4.2.5
+
+-------------------------------------------------------------------
 Wed Nov  6 11:32:29 UTC 2019 - Stefan Hundhammer <[email protected]>
 
 - Added symbol for new UI CustomStatusItemSelector widget
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.2.4/package/yast2-ruby-bindings.spec 
new/yast2-ruby-bindings-4.2.5/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-4.2.4/package/yast2-ruby-bindings.spec      
2019-11-06 12:41:30.000000000 +0100
+++ new/yast2-ruby-bindings-4.2.5/package/yast2-ruby-bindings.spec      
2019-12-06 11:56:45.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        4.2.4
+Version:        4.2.5
 Url:            https://github.com/yast/yast-ruby-bindings
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.2.4/src/ruby/yast/y2start_helpers.rb 
new/yast2-ruby-bindings-4.2.5/src/ruby/yast/y2start_helpers.rb
--- old/yast2-ruby-bindings-4.2.4/src/ruby/yast/y2start_helpers.rb      
2019-11-06 12:41:30.000000000 +0100
+++ new/yast2-ruby-bindings-4.2.5/src/ruby/yast/y2start_helpers.rb      
2019-12-06 11:56:45.000000000 +0100
@@ -69,6 +69,47 @@
       end
     end
 
+    # Returns application title string
+    def self.application_title(client_name)
+      # do not fail if gethostname failed
+      hostname = Socket.gethostname rescue ""
+      hostname = "" if hostname == "(none)"
+      hostname = " @ #{hostname}" unless hostname.empty?
+      if is_s390
+        # e.g. stdout "2964 = z13 IBM z13" transfered into "IBM z13"
+        arch_array = read_values.split("=")
+        arch_array.shift if arch_array.size > 1
+        architecture = arch_array.join(' ').strip
+        arch_array = architecture.split(' ')
+        arch_array.shift if arch_array.size > 1
+        architecture = arch_array.join(' ')
+
+        if !Yast::UI.TextMode
+          # Show the S390 architecutue in the QT banner only.
+          # The environment variable YAST_BANNER will be read and shown
+          # in libyui-qt.
+          ENV["YAST_BANNER"] = architecture
+          architecture = ""
+        end
+      else
+        architecture = ""
+      end
+      left_title = "YaST2 - #{client_name}#{hostname}"
+      left_title + architecture.rjust(80-left_title.size)
+    end
+
+    private_class_method def self.read_values
+      arch = `/usr/bin/read_values -c`.strip
+      return "" unless $?.success?
+      arch
+    end 
+
+    private_class_method def self.is_s390
+      arch = `/usr/bin/arch`.strip
+      return false unless $?.success?
+      arch.start_with?("s390")
+    end
+
     private_class_method def self.signal_handler(name)
       Signal.trap(name, "IGNORE")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-4.2.4/src/y2start/y2start 
new/yast2-ruby-bindings-4.2.5/src/y2start/y2start
--- old/yast2-ruby-bindings-4.2.4/src/y2start/y2start   2019-11-06 
12:41:30.000000000 +0100
+++ new/yast2-ruby-bindings-4.2.5/src/y2start/y2start   2019-12-06 
11:56:45.000000000 +0100
@@ -48,16 +48,12 @@
 Yast.ui_create(args[:server_name], args[:server_options])
 # set application title bsc#1033161
 Yast.import "UI"
-# do not fail if gethostname failed
-hostname = Socket.gethostname rescue ""
-hostname = "" if hostname == "(none)"
-hostname = " @ #{hostname}" unless hostname.empty?
 
-title = "YaST2 - #{args[:client_name]}#{hostname}"
 # set title only if it is not CLI (bsc#1033993)
 # modules do not have CLI arguments, except installation (bsc#1037891)
 set_title = args[:client_options][:params].empty? || 
NO_CLI_CLIENTS.include?(args[:client_name])
-Yast::UI.SetApplicationTitle(title) if set_title
+Yast::UI.SetApplicationTitle(
+  Yast::Y2StartHelpers.application_title(args[:client_name])) if set_title
 
 Yast::WFM.CallFunction(args[:client_name], args[:client_options][:params])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.2.4/tests/y2start_helpers_spec.rb 
new/yast2-ruby-bindings-4.2.5/tests/y2start_helpers_spec.rb
--- old/yast2-ruby-bindings-4.2.4/tests/y2start_helpers_spec.rb 2019-11-06 
12:41:30.000000000 +0100
+++ new/yast2-ruby-bindings-4.2.5/tests/y2start_helpers_spec.rb 2019-12-06 
11:56:45.000000000 +0100
@@ -47,4 +47,64 @@
       end
     end
   end
+
+  describe ".application_title" do
+    before do
+      stub_const("Yast::UI", double("Yast::UI"))
+    end
+
+    context "s390 architecture" do
+      before do
+        allow(subject).to receive(:is_s390).and_return(true)
+      end
+
+      context "is in text mode" do
+        it "returns s390 architecture" do
+          expect(subject).to receive(:read_values).and_return("2964 = z13 IBM 
z13")
+          expect(Yast::UI).to receive(:TextMode).and_return(true)
+          expect(subject.application_title("client_name")).to match(/IBM z13/)
+        end
+      end
+
+      context "is in QT mode" do
+        it "sets environment variable YAST_BANNER" do
+          expect(subject).to receive(:read_values).and_return("2964 = z13 IBM 
z13")
+          expect(Yast::UI).to receive(:TextMode).and_return(false)
+          expect(subject.application_title("client_name")).not_to match(/IBM 
z13/)
+          expect(ENV["YAST_BANNER"]).to eq("IBM z13")
+          # unset YAST_BANNER for further tests
+          ENV["YAST_BANNER"] = ""
+        end
+      end
+
+      context "read_values returns empty string" do
+        it "returns client name only" do
+          expect(subject).to receive(:read_values).and_return("")
+          expect(Yast::UI).to receive(:TextMode).and_return(true)
+          expect(subject.application_title("client_name").strip).to eq("YaST2 
- client_name")
+        end
+      end
+    end
+
+    context "x86_64 archtecture" do
+      before do
+        allow(subject).to receive(:is_s390).and_return(false)
+        expect(subject).not_to receive(:read_values)
+      end
+
+      context "is in text mode" do
+        it "returns client name only" do
+          expect(subject.application_title("client_name").strip).to eq("YaST2 
- client_name")
+        end
+      end
+
+      context "is in QT mode" do
+        it "does not set environment variable YAST_BANNER" do
+          expect(subject.application_title("client_name").strip).to eq("YaST2 
- client_name")
+          expect(ENV["YAST_BANNER"]).to eq("")
+        end
+      end
+    end
+  end
+
 end


Reply via email to