Hello community, here is the log from the commit of package yast2-ruby-bindings for openSUSE:Factory checked in at 2017-03-29 13:22:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old) and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-ruby-bindings" Wed Mar 29 13:22:29 2017 rev:78 rq:482277 version:3.2.9 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes 2017-03-15 02:00:02.842433784 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 2017-03-29 13:22:32.465681052 +0200 @@ -1,0 +2,15 @@ +Wed Mar 22 14:45:50 UTC 2017 - jreidinger@suse.com + +- Use more friendly exception when an invalid Yast::Path is + constructed (one with a component starting or ending with + a dash; bsc#1028081) +- 3.2.9 + +------------------------------------------------------------------- +Wed Mar 22 14:41:50 UTC 2017 - jreidinger@suse.com + +- add method Yast::WFM.scr_root to get scr changed root directory + (needed for testing fix for bsc#1023204) +- 3.2.8 + +------------------------------------------------------------------- @@ -42 +56,0 @@ - Old: ---- yast2-ruby-bindings-3.2.7.tar.bz2 New: ---- yast2-ruby-bindings-3.2.9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-ruby-bindings.spec ++++++ --- /var/tmp/diff_new_pack.iRNG1z/_old 2017-03-29 13:22:33.477537951 +0200 +++ /var/tmp/diff_new_pack.iRNG1z/_new 2017-03-29 13:22:33.481537385 +0200 @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 3.2.7 +Version: 3.2.9 Release: 0 Url: https://github.com/yast/yast-ruby-bindings BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-ruby-bindings-3.2.7.tar.bz2 -> yast2-ruby-bindings-3.2.9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/package/yast2-ruby-bindings.changes new/yast2-ruby-bindings-3.2.9/package/yast2-ruby-bindings.changes --- old/yast2-ruby-bindings-3.2.7/package/yast2-ruby-bindings.changes 2017-03-14 17:47:00.112198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/package/yast2-ruby-bindings.changes 2017-03-23 15:46:15.160272844 +0100 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Wed Mar 22 14:45:50 UTC 2017 - jreidinger@suse.com + +- Use more friendly exception when an invalid Yast::Path is + constructed (one with a component starting or ending with + a dash; bsc#1028081) +- 3.2.9 + +------------------------------------------------------------------- +Wed Mar 22 14:41:50 UTC 2017 - jreidinger@suse.com + +- add method Yast::WFM.scr_root to get scr changed root directory + (needed for testing fix for bsc#1023204) +- 3.2.8 + +------------------------------------------------------------------- Tue Mar 14 16:25:59 UTC 2017 - ancor@suse.com - Use tmux instead of screen to run the Ncurses integration test @@ -40,7 +55,6 @@ loading namespace to component system failed (bsc#932331) - 3.2.4 - ------------------------------------------------------------------- Thu Dec 15 16:29:13 UTC 2016 - igonzalezsosa@suse.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/package/yast2-ruby-bindings.spec new/yast2-ruby-bindings-3.2.9/package/yast2-ruby-bindings.spec --- old/yast2-ruby-bindings-3.2.7/package/yast2-ruby-bindings.spec 2017-03-14 17:47:00.112198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/package/yast2-ruby-bindings.spec 2017-03-23 15:46:15.160272844 +0100 @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 3.2.7 +Version: 3.2.9 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.2.7/src/ruby/yast/path.rb new/yast2-ruby-bindings-3.2.9/src/ruby/yast/path.rb --- old/yast2-ruby-bindings-3.2.7/src/ruby/yast/path.rb 2017-03-14 17:47:00.120198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/src/ruby/yast/path.rb 2017-03-23 15:46:15.168272844 +0100 @@ -6,6 +6,9 @@ class Path include Comparable + # @param value [String] string representation of path + # @raise RuntimeError if invalid path is passed. Invalid path is one where + # any element starts or ends with dash like ".-etc", ".etc-" or ".e.t-.c" def initialize(value) if !value.is_a?(::String) raise ArgumentError, "Yast::Path constructor has to get ::String as " \ @@ -85,7 +88,7 @@ when :simple if c == "." state = :dot - break if invalid_buffer?(buffer) + raise "Invalid path '#{value}'" if invalid_buffer?(buffer) @components << modify_buffer(buffer) buffer = "" @@ -116,15 +119,13 @@ return if buffer.empty? - return if invalid_buffer?(buffer) + raise "Invalid path '#{value}'" if invalid_buffer?(buffer) @components << modify_buffer(buffer) end def invalid_buffer?(buffer) if buffer.start_with?("-") || buffer.end_with?("-") - Yast.y2error "Cannot have dash before or after dot '#{value}'" - @components.clear return true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/src/ruby/yast/wfm.rb new/yast2-ruby-bindings-3.2.9/src/ruby/yast/wfm.rb --- old/yast2-ruby-bindings-3.2.7/src/ruby/yast/wfm.rb 2017-03-14 17:47:00.120198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/src/ruby/yast/wfm.rb 2017-03-23 15:46:15.172272844 +0100 @@ -119,6 +119,20 @@ SCRGetName(SCRGetDefault()) != "scr" end + # Returns root on which scr operates. + # @return [String] path e.g. "/" when scr not switched + # or "/mnt" when installation was switched. + def self.scr_root + case SCRGetName(SCRGetDefault()) + when "scr" + "/" + when /chroot=(.*):scr/ + Regexp.last_match(1) + else + raise "invalid SCR instance #{SCRGetName(SCRGetDefault())}" + end + end + # Creates new SCR instance # # It is useful for installation where agents start operation on installed system @@ -264,6 +278,5 @@ return false end end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/tests/path_spec.rb new/yast2-ruby-bindings-3.2.9/tests/path_spec.rb --- old/yast2-ruby-bindings-3.2.7/tests/path_spec.rb 2017-03-14 17:47:00.136198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/tests/path_spec.rb 2017-03-23 15:46:15.176272844 +0100 @@ -10,15 +10,25 @@ it "works for simple paths" do expect(Yast::Path.new(".etc").to_s).to eq(".etc") end + it "works for complex paths" do expect(Yast::Path.new(".et?c").to_s).to eq('."et?c"') end + + it "raise RuntimeError if path is invalid" do + expect{Yast::Path.new(".-etc")}.to raise_error(RuntimeError) + end + + it "raise ArgumentError if argument is not String" do + expect{Yast::Path.new(nil)}.to raise_error(ArgumentError) + end end describe ".from_string" do it "works for simple paths" do expect(Yast::Path.from_string("etc").to_s).to eq(".\"etc\"") end + it "works for complex paths" do expect(Yast::Path.from_string("et?c").to_s).to eq('."et?c"') end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/tests/scr_spec.rb new/yast2-ruby-bindings-3.2.9/tests/scr_spec.rb --- old/yast2-ruby-bindings-3.2.7/tests/scr_spec.rb 2017-03-14 17:47:00.136198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/tests/scr_spec.rb 2017-03-23 15:46:15.176272844 +0100 @@ -16,7 +16,7 @@ end it "raises exception if first is not String or Yast::Path" do - expect{Yast::SCR.public_send(method, 1, *args)}.to raise_error(ArgumentError) + expect { Yast::SCR.public_send(method, 1, *args) }.to raise_error(ArgumentError) end it "passed path arguments with method name prepended to underlayer wrapper" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.2.7/tests/wfm_spec.rb new/yast2-ruby-bindings-3.2.9/tests/wfm_spec.rb --- old/yast2-ruby-bindings-3.2.7/tests/wfm_spec.rb 2017-03-14 17:47:00.140198654 +0100 +++ new/yast2-ruby-bindings-3.2.9/tests/wfm_spec.rb 2017-03-23 15:46:15.180272844 +0100 @@ -59,5 +59,19 @@ WFM.SCRSetDefault(old_handle) end end + + describe ".scr_root" do + it "returns root path of scr" do + expect(WFM.scr_root).to eq "/" + + old_handle = WFM.SCRGetDefault + handle = WFM.SCROpen("chroot=/tmp:scr", false) + WFM.SCRSetDefault(handle) + + expect(WFM.scr_root).to eq "/tmp" + + WFM.SCRSetDefault(old_handle) + end + end end end