From bf22c7de4a77ae70b84970d65a12d07b20236f85 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 22 Mar 2017 15:53:05 +0100 Subject: [PATCH 1/2] use for cfa and execute real switched scr --- library/system/src/lib/yast2/execute.rb | 5 +---- library/system/src/lib/yast2/target_file.rb | 5 +---- package/yast2.spec | 6 +++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/library/system/src/lib/yast2/execute.rb b/library/system/src/lib/yast2/execute.rb index 8bea7687d..2fa4d1b81 100644 --- a/library/system/src/lib/yast2/execute.rb +++ b/library/system/src/lib/yast2/execute.rb @@ -23,8 +23,6 @@ require "yast" require "cheetah" -Yast.import "Installation" - module Yast # Module for executing scripts/programs in safe way. Uses cheetah as backend, # but adds support for chrooting in installation. @@ -39,8 +37,7 @@ class Execute # @see http://www.rubydoc.info/github/openSUSE/cheetah/Cheetah.run parameter docs # @raise Cheetah::ExecutionFailed def self.on_target(*args) - root = "/" - root = Yast::Installation.destdir if Yast::WFM.scr_chrooted? + root = Yast::WFM.scr_root if args.last.is_a? ::Hash args.last[:chroot] = root diff --git a/library/system/src/lib/yast2/target_file.rb b/library/system/src/lib/yast2/target_file.rb index 3d4a27af8..5ee56de15 100644 --- a/library/system/src/lib/yast2/target_file.rb +++ b/library/system/src/lib/yast2/target_file.rb @@ -24,8 +24,6 @@ require "cfa/base_model" -Yast.import "Installation" - module Yast # A file handler suitable for CFA::BaseModel (from config_files_api.gem) # that respects Yast::Installation.destdir. When this class is `require`d, @@ -42,8 +40,7 @@ def self.write(path, content) end def self.final_path(path) - root = "/" - root = Yast::Installation.destdir if Yast::WFM.scr_chrooted? + root = Yast::WFM.scr_root ::File.join(root, path) end diff --git a/package/yast2.spec b/package/yast2.spec index 9386bdaa1..64a6cdf68 100644 --- a/package/yast2.spec +++ b/package/yast2.spec @@ -43,8 +43,8 @@ BuildRequires: rubygem(%{rb_default_ruby_abi}:rspec) BuildRequires: yast2-core >= 2.18.12 BuildRequires: yast2-devtools >= 3.1.10 BuildRequires: yast2-pkg-bindings >= 2.20.3 -# To have Yast::CoreExt::AnsiString -BuildRequires: yast2-ruby-bindings >= 3.1.36 +# To have Yast::WFM.scr_root +BuildRequires: yast2-ruby-bindings >= 3.2.8 BuildRequires: yast2-testsuite BuildRequires: yast2-ycp-ui-bindings >= 3.1.8 # for the PackageExtractor tests, just make sure they are present, @@ -76,7 +76,7 @@ Requires: yast2-hardware-detection Requires: yast2-perl-bindings # changed StartPackage callback signature Requires: yast2-pkg-bindings >= 2.20.3 -Requires: yast2-ruby-bindings >= 3.1.33 +Requires: yast2-ruby-bindings >= 3.2.8 Requires: yast2-xml # new UI::SetApplicationIcon Requires: yast2-ycp-ui-bindings >= 3.1.8 From fe876ad4f5c0b2ed77f5fe9c9b7e2195007ebd44 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 22 Mar 2017 15:54:29 +0100 Subject: [PATCH 2/2] changes --- package/yast2.changes | 8 ++++++++ package/yast2.spec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package/yast2.changes b/package/yast2.changes index e9d3fd112..a52e58d3d 100644 --- a/package/yast2.changes +++ b/package/yast2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Mar 22 14:53:07 UTC 2017 - jreidinger@suse.com + +- Use for Yast::TargetFile and Yast::Execute real path where scr + operates. It allows easier switching scr in unit tests. + (needed for testing fix for bsc#1023204) +- 3.2.20 + ------------------------------------------------------------------- Mon Mar 20 10:11:52 UTC 2017 - lslezak@suse.cz diff --git a/package/yast2.spec b/package/yast2.spec index 64a6cdf68..3a93ab0e3 100644 --- a/package/yast2.spec +++ b/package/yast2.spec @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.2.19 +Version: 3.2.20 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0