Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9433 - in /trunk/sat-solver/bindings/ruby/tests: _patch.rb _solv2patches.rb patches.solv
  • From: kkaempf@xxxxxxxxxxxxxxxx
  • Date: Mon, 07 Apr 2008 15:11:38 -0000
  • Message-id: <20080407151138.A94B526EFF@xxxxxxxxxxxxxxxx>
Author: kkaempf
Date: Mon Apr 7 17:11:38 2008
New Revision: 9433

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9433&view=rev
Log:
fix patch attribute access

Modified:
trunk/sat-solver/bindings/ruby/tests/_patch.rb
trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb
trunk/sat-solver/bindings/ruby/tests/patches.solv

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=9433&r1=9432&r2=9433&view=diff
==============================================================================
--- trunk/sat-solver/bindings/ruby/tests/_patch.rb (original)
+++ trunk/sat-solver/bindings/ruby/tests/_patch.rb Mon Apr 7 17:11:38 2008
@@ -18,7 +18,8 @@
class Patch
attr_reader :name, :evr
attr_reader :timestamp, :category
- attr_reader :summary, :description
+ attr_accessor :summary, :description
+ attr_accessor :restart, :reboot
attr_reader :contains

def initialize name, evr, category, timestamp
@@ -29,13 +30,6 @@
@contains = []
end

- def summary= summary
- @summary = summary
- end
- def description= description
- @description = description
- end
-
def add name,evr,arch
@contains << Item.new( name, evr, arch )
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=9433&r1=9432&r2=9433&view=diff
==============================================================================
--- trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb (original)
+++ trunk/sat-solver/bindings/ruby/tests/_solv2patches.rb Mon Apr 7 17:11:38
2008
@@ -1,6 +1,21 @@
#
# Convert .solv file to Code11 Patches
#
+#
+# solvable:name (type repokey:type:id size 0 storage 1)
+# solvable:arch (type repokey:type:id size 0 storage 1)
+# solvable:evr (type repokey:type:id size 0 storage 1)
+# solvable:provides (type repokey:type:relidarray size 16 storage 1)
+# solvable:requires (type repokey:type:relidarray size 22 storage 1)
+# solvable:freshens (type repokey:type:relidarray size 14 storage 1)
+# solvable:buildtime (type repokey:type:num size 0 storage 2)
+# solvable:summary (type repokey:type:str size 0 storage 2)
+# solvable:description (type repokey:type:str size 10363 storage 3)
+# solvable:patchcategory (type repokey:type:str size 0 storage 2)
+# update:restart
+# update:reboot
+#
+#

require 'satsolver'
require '_patch'
@@ -18,6 +33,9 @@
repo.add_solv( solvname ) if solvname
STDERR.puts "#{repo.size} patches and stuff"

+
+ # split .solv to atoms and patches
+
atoms = Hash.new
patches = Hash.new

@@ -60,9 +78,9 @@
patches.each { |name,store|
store.each { |evr,patch|

- p = Patch.new( name, evr, patch.category, patch.timestamp )
- p.summary = patch.summary
- p.description = patch.description
+ 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"

patch.requires.each { |req|
sp = req.name.split ":"

Modified: trunk/sat-solver/bindings/ruby/tests/patches.solv
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/patches.solv?rev=9433&r1=9432&r2=9433&view=diff
==============================================================================
Binary files - no diff available.

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages