ref: refs/heads/master
commit 811b2b5eaa9ec3dfeaf4ecdc10ee2afb4d091815
Author: Klaus Kämpf
Date: Thu Aug 6 11:15:16 2009 +0200
Adapt to splitted yast2-dbus-server
---
webservice/doc/check-setup.rb | 43 +++++++++++++++++++++++++++++++---------
1 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/webservice/doc/check-setup.rb b/webservice/doc/check-setup.rb
index f803c02..838b58b 100755
--- a/webservice/doc/check-setup.rb
+++ b/webservice/doc/check-setup.rb
@@ -30,13 +30,14 @@ def test_module name, package
end
end
-def test_version package, version
+def test_version package, need_version
v = `rpm -q #{package}`
- escape v, "install #{package} >= #{version}" if v =~ /is not installed/
- nvr = v.split "-"
- rel = nvr.pop
- ver = nvr.pop
- escape "#{package} not up-to-date", "upgrade to #{package}-#{version}" if ver < version
+ escape v, "install #{package} >= #{need_version}" if v =~ /is not installed/
+ nvr = v.chomp.split "-"
+ have_release = nvr.pop
+ have_version = nvr.pop
+ escape "#{package} not up-to-date", "upgrade to #{package}-#{need_version}" if have_version < need_version
+ true
end
###
@@ -81,23 +82,45 @@ test "YaST D-Bus service available" do
rescue Exception => e
end
escape "System error, cannot access D-Bus SystemBus" unless bus
+
begin
proxy = bus.introspect( "org.opensuse.yast.SCR", "/SCR" )
rescue Exception => e
end
- package = "yast2-core"
- version = "2.18.10"
+
+ os_version = nil
+ # check if we're on openSUSE 11.2, this has yast2-dbus-service splitted from yast2-core
+ File.open("/etc/SuSE-release") do |fd|
+ fd.each do |line|
+ next unless line =~ /^VERSION = (.*)/
+ os_version = $1
+ end
+ end rescue nil
+
+ if os_version == "11.2"
+ package = "yast2-dbus-server"
+ version = "2.18.0"
+ else
+ package = "yast2-core"
+ version = "2.18.10"
+ end
+
unless proxy
$stderr.puts "YaST D-Bus service not available"
- test_version package, version
- escape "#{package} not correctly installed", "reinstall #{package}-#{version}"
+ unless test_version package, version
+ escape "#{package} not correctly installed", "reinstall #{package}-#{version}"
+ end
+ exit
end
+
begin
scr = proxy["org.opensuse.yast.SCR.Methods"]
rescue Exception => e
+ $stderr.puts "scr failed: #{e}"
end
escape "YaST D-Bus does not provide the right data", "reinstall #{package}-#{version}" unless scr
end
puts "All fine, rest-service is ready to run"
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org