Hello community,

here is the log from the commit of package yast2-ruby-bindings for 
openSUSE:Factory checked in at 2016-01-13 22:43:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-ruby-bindings"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes  
2015-12-06 07:31:52.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 
    2016-01-13 22:43:13.000000000 +0100
@@ -1,0 +2,27 @@
+Wed Jan 13 09:36:59 UTC 2016 - [email protected]
+
+- Move transdb initialization to C part to keep it together with
+  index initialization (bsc#932014)
+- 3.1.46
+
+-------------------------------------------------------------------
+Wed Jan 13 08:52:21 UTC 2016 - [email protected]
+
+- fixed early return from logging method causing failure of old
+  testsuite (bsc#932014)
+- 3.1.45
+
+-------------------------------------------------------------------
+Tue Jan 12 15:05:40 UTC 2016 - [email protected]
+
+- Fixed conflict between Yast::Encoding and ::Encoding (another fix
+  for bsc#932014)
+- 3.1.44
+
+-------------------------------------------------------------------
+Mon Jan 11 12:56:37 UTC 2016 - [email protected]
+
+- Do not crash when logging an invalid UTF-8 string (bsc#932014)
+- 3.1.43
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.nW80JD/_old  2016-01-13 22:43:14.000000000 +0100
+++ /var/tmp/diff_new_pack.nW80JD/_new  2016-01-13 22:43:14.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-ruby-bindings
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # 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-ruby-bindings
-Version:        3.1.42
+Version:        3.1.46
 Release:        0
 Url:            https://github.com/yast/yast-ruby-bindings
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-ruby-bindings-3.1.42.tar.bz2 -> yast2-ruby-bindings-3.1.46.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.42/package/yast2-ruby-bindings.changes 
new/yast2-ruby-bindings-3.1.46/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.42/package/yast2-ruby-bindings.changes  
2015-12-01 17:26:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.46/package/yast2-ruby-bindings.changes  
2016-01-13 11:00:12.000000000 +0100
@@ -1,4 +1,31 @@
 -------------------------------------------------------------------
+Wed Jan 13 09:36:59 UTC 2016 - [email protected]
+
+- Move transdb initialization to C part to keep it together with
+  index initialization (bsc#932014)
+- 3.1.46
+
+-------------------------------------------------------------------
+Wed Jan 13 08:52:21 UTC 2016 - [email protected]
+
+- fixed early return from logging method causing failure of old
+  testsuite (bsc#932014)
+- 3.1.45
+
+-------------------------------------------------------------------
+Tue Jan 12 15:05:40 UTC 2016 - [email protected]
+
+- Fixed conflict between Yast::Encoding and ::Encoding (another fix
+  for bsc#932014)
+- 3.1.44
+
+-------------------------------------------------------------------
+Mon Jan 11 12:56:37 UTC 2016 - [email protected]
+
+- Do not crash when logging an invalid UTF-8 string (bsc#932014)
+- 3.1.43
+
+-------------------------------------------------------------------
 Tue Dec  1 16:06:11 UTC 2015 - [email protected]
 
 - Reverted the last change because it broke updating the table in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.42/package/yast2-ruby-bindings.spec 
new/yast2-ruby-bindings-3.1.46/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.42/package/yast2-ruby-bindings.spec     
2015-12-01 17:26:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.46/package/yast2-ruby-bindings.spec     
2016-01-13 11:00:12.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        3.1.42
+Version:        3.1.46
 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-3.1.42/src/binary/YRuby.cc 
new/yast2-ruby-bindings-3.1.46/src/binary/YRuby.cc
--- old/yast2-ruby-bindings-3.1.42/src/binary/YRuby.cc  2015-12-01 
17:26:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.46/src/binary/YRuby.cc  2016-01-13 
11:00:12.000000000 +0100
@@ -66,7 +66,7 @@
   ruby_init();
   ruby_init_loadpath();
 
-  // FIX for setup gem load path. Embedded ruby initialization mixes up gem 
+  // FIX for setup gem load path. Embedded ruby initialization mixes up gem
   // initialization (which we want) with option processing (which we don't 
want).
   // Copying only needed parts of `ruby_options` here.
   // See http://subforge.org/blogs/show/1
@@ -74,6 +74,9 @@
   rb_define_module("Gem");
   y2_require("rubygems");
 
+  // encoding initialization
+  y2_require("enc/encdb.so");
+  y2_require("enc/trans/transdb.so");
   rb_enc_find_index("encdb");
 
   VALUE ycp_references = Data_Wrap_Struct(rb_cObject, gc_mark, gc_free, & 
value_references_from_ycp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.42/src/ruby/yast/logger.rb 
new/yast2-ruby-bindings-3.1.46/src/ruby/yast/logger.rb
--- old/yast2-ruby-bindings-3.1.42/src/ruby/yast/logger.rb      2015-12-01 
17:26:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.46/src/ruby/yast/logger.rb      2016-01-13 
11:00:12.000000000 +0100
@@ -17,7 +17,22 @@
       end
     end
 
-    res = Builtins.sformat(*args)
+    # replace invalid characters by the replacement symbol
+    # see 
https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character
+    safe_args = args.map do |arg|
+      next arg unless arg.is_a?(::String)
+
+      # Be carefull, there is also Yast::Encoding!!
+      if arg.encoding == ::Encoding::UTF_8
+        arg.scrub("�")
+      else
+        # broken strings might be passed as e.g. ASCII-8BIT and need to be 
recoded
+        # Be carefull, there is also Yast::Encoding!!
+        arg.encode(::Encoding::UTF_8, invalid: :replace, undef: :replace, 
replace: "�")
+      end
+    end
+
+    res = Builtins.sformat(*safe_args)
     res.gsub!(/%/, "%%") # reescape all %
     caller[caller_frame] =~ /(.+):(\d+):in `([^']+)'/
     y2_logger(level, "Ruby", Regexp.last_match(1), Regexp.last_match(2).to_i, 
Regexp.last_match(3), res)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.42/tests/ruby/y2logger_spec.rb 
new/yast2-ruby-bindings-3.1.46/tests/ruby/y2logger_spec.rb
--- old/yast2-ruby-bindings-3.1.42/tests/ruby/y2logger_spec.rb  2015-12-01 
17:26:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.46/tests/ruby/y2logger_spec.rb  2016-01-13 
11:00:12.000000000 +0100
@@ -41,6 +41,29 @@
       expect(Yast).to receive(:y2milestone).with(Y2Logger::CALL_FRAME, 
TEST_MESSAGE)
       @test_logger.info { TEST_MESSAGE }
     end
+
+    it "does not crash when logging an invalid UTF-8 string" do
+      # do not process this string otherwise you'll get an exception :-)
+      invalid_utf8 = "invalid sequence: \xE3\x80"
+      # just make sure it is really an UTF-8 string
+      expect(invalid_utf8.encoding).to eq(Encoding::UTF_8)
+      expect { Yast.y2milestone(invalid_utf8) }.not_to raise_error
+    end
+
+    it "does not crash when logging ASCII string with invalid UTF-8" do
+      # do not process this string otherwise you'll get an exception :-)
+      invalid_ascii = "invalid sequence: \xE3\x80"
+      invalid_ascii.force_encoding(Encoding::ASCII)
+      expect { Yast.y2milestone(invalid_ascii) }.not_to raise_error
+    end
+
+    it "processes parameters using Builtins::sformat" do
+      expected_log_msg = "test 1 2"
+      expect(Yast).to receive(:y2_logger)
+        .with(anything, "Ruby", anything, anything, anything, expected_log_msg)
+
+      Yast.y2milestone("test %1 %2", 1, 2)
+    end
   end
 
   describe Yast::Logger do


Reply via email to