Author: kkaempf Date: Fri Dec 21 19:41:09 2007 New Revision: 8137 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8137&view=rev Log: fix Dependency.each Modified: trunk/sat-solver/bindings/ruby/tests/repo.rb trunk/sat-solver/bindings/ruby/tests/solvable.rb trunk/sat-solver/bindings/satsolver.i Modified: trunk/sat-solver/bindings/ruby/tests/repo.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/repo.rb?rev=8137&r1=8136&r2=8137&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/repo.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/repo.rb Fri Dec 21 19:41:09 2007 @@ -22,4 +22,16 @@ puts repo.name puts repo.size end + def test_deps + pool = SatSolver::Pool.new + assert pool + repo = SatSolver::Repo.new( pool, "test" ) + assert repo + pool.arch = "i686" + puts repo.add_solv( "../../../testsuite/data.libzypp/basic-exercises/exercise-1-packages.solv" ) + repo.each_solvable{ |s| + puts s + } + assert true + end end Modified: trunk/sat-solver/bindings/ruby/tests/solvable.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/solvable.rb?rev=8137&r1=8136&r2=8137&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/solvable.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/solvable.rb Fri Dec 21 19:41:09 2007 @@ -13,7 +13,7 @@ i += 1 end # does not work yet -# deps.each { |d| puts d } + deps.each { |d| puts d } end class SolvableTest < Test::Unit::TestCase Modified: trunk/sat-solver/bindings/satsolver.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=8137&r1=8136&r2=8137&view=diff ============================================================================== --- trunk/sat-solver/bindings/satsolver.i (original) +++ trunk/sat-solver/bindings/satsolver.i Fri Dec 21 19:41:09 2007 @@ -146,7 +146,7 @@ int installable( Solvable *s ) { return pool_installable( $self,s ); } - /* without the %rename, swig converts it to id_2solvable. Ouch! */ + /* without the %rename, swig converts it to 'id_2solvable'. Ouch! */ %rename( "id2solvable" ) id2solvable( Id p ); Solvable *id2solvable(Id p) { return pool_id2solvable( $self, p ); } @@ -235,7 +235,7 @@ Id p; for (p = 0, s = $self->pool->solvables + $self->start; p < $self->nsolvables; p++, s++) { - if (!s->name) + if (!s) continue; rb_yield( SWIG_NewPointerObj((void*) s, SWIGTYPE_p__Solvable, 0) ); } @@ -292,7 +292,7 @@ if ($self->relation) { Id *ids = $self->solvable->repo->idarraydata + $self->relation; while (*ids) { - rb_yield( SWIG_NewPointerObj((void*) *ids, SWIGTYPE_p__Relation, 0) ); + rb_yield( SWIG_NewPointerObj((void*) relation_new( *ids, $self->solvable->repo->pool ), SWIGTYPE_p__Relation, 0) ); ++ids; } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org