Author: kkaempf Date: Mon Apr 7 18:22:18 2008 New Revision: 9436 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9436&view=rev Log: fix attributes when creating 'updateinfo.xml' from a patches.solv file Modified: trunk/sat-solver/bindings/ruby/tests/_patch.rb trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb trunk/sat-solver/bindings/ruby/tests/patchsolv2updateinfo.rb Modified: trunk/sat-solver/bindings/ruby/tests/_patch.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/_patch.rb?rev=9436&r1=9435&r2=9436&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/_patch.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/_patch.rb Mon Apr 7 18:22:18 2008 @@ -28,6 +28,8 @@ @category = category @timestamp = timestamp @contains = [] + @reboot = nil + @restart = nil end def add name,evr,arch @@ -38,8 +40,10 @@ s = "Name: #{@name}-#{@evr}\n" + " Category: #{@category}\n" + " Timestamp: #{@timestamp}\n" + - " Summary: #{@summary}\n" + - " Contains[#{@contains.size}]:\n" + " Summary: #{@summary}\n" + s += " Reboot!\n" if @reboot + s += " Restart!\n" if @restart + s += " Contains[#{@contains.size}]:\n" @contains.each { |i| s += " #{i}\n" } s end Modified: trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb?rev=9436&r1=9435&r2=9436&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb Mon Apr 7 18:22:18 2008 @@ -65,6 +65,8 @@ end } + STDERR.puts "Splitted into #{patches.size} patches and #{atoms.size} atoms" + # # Now iterate through all patches # - ensure that it requires just atoms @@ -76,12 +78,15 @@ out_patches = [] patches.each { |name,store| +# STDERR.puts "Patch #{name}" store.each { |evr,patch| - +# STDERR.puts "-#{evr}" p = Patch.new( name, evr, patch.attr( "solvable:patchcategory" ), patch.attr( "solvable:buildtime" )) p.summary = patch.attr "solvable:summary" p.description = patch.attr "solvable:description" - + p.reboot = patch.attr "update:reboot" + p.restart = patch.attr "update:restart" +# STDERR.puts "=> #{p}" patch.requires.each { |req| sp = req.name.split ":" Modified: trunk/sat-solver/bindings/ruby/tests/patchsolv2updateinfo.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/patchsolv2updateinfo.rb?rev=9436&r1=9435&r2=9436&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/patchsolv2updateinfo.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/patchsolv2updateinfo.rb Mon Apr 7 18:22:18 2008 @@ -37,6 +37,8 @@ if attrs.empty? # empty string? -> close tag immediately puts "/>" else + attrs.gsub!( "<", "<" ) + attrs.gsub!( ">", ">" ) puts ">#{attrs}#{tag}>" # text</tag> end return nil @@ -62,7 +64,9 @@ # STDERR.puts "Reading #{solvname}" next if solvname[0,1] == "." repo.add_solv( "patches/#{solvname}" ) -} +} + +STDERR.puts "Converting now ..." patches = solv2patches nil, repo puts "<?xml version=\"1.0\"?>" @@ -70,6 +74,7 @@ indent = 1 patches.each { |p| +# STDERR.puts "#{p.name}-#{p.evr}" endtag = xmlout "update", indent, "from" => "maint-coord@suse.de", "status"=>"stable", "type"=>p.category, "version"=>"11.0" indent += 1 xmlout "id", indent, "#{p.name}-#{p.evr}" @@ -86,6 +91,8 @@ vr = item.evr.split "-" pkgend = xmlout "package", indent, "name" => item.name, "version" => vr[0], "release" => vr[1], "arch" => item.arch xmlout "filename", indent+1, "#{item.name}-#{item.evr}.#{item.arch}.rpm" + xmlout( "reboot_suggested", indent+1, "True" ) if p.reboot + xmlout( "restart_suggested", indent+1, "True" ) if p.restart puts pkgend } indent -= 1 -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org