[zypp-devel] [PATCH] make sure pool is prepared() in Perl's providers()
This avoids a Segmentation fault. Fix inspired by the Ruby bindings. Index: bindings/pool.i =================================================================== --- bindings/pool.i (revision 11678) +++ bindings/pool.i (working copy) @@ -230,6 +230,11 @@ sub providers { my ($self, $rel) = @_; my @prov = (); + + if ($self->unprepared()) { + $self->prepare(); + } + my $count = $self->providers_count($rel); for (my $i = 0; $i < $count; ++$i) { my $solvable = $self->providers_get($rel, $i); -- Olaf Dabrunz (od/odabrunz) SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Olaf Dabrunz <od@suse.de> [Nov 13. 2008 17:03]:
This avoids a Segmentation fault. Fix inspired by the Ruby bindings.
Thanks. Submitted as svn rev 11680. Klaus
Index: bindings/pool.i =================================================================== --- bindings/pool.i (revision 11678) +++ bindings/pool.i (working copy) @@ -230,6 +230,11 @@ sub providers { my ($self, $rel) = @_; my @prov = (); + + if ($self->unprepared()) { + $self->prepare(); + } + my $count = $self->providers_count($rel); for (my $i = 0; $i < $count; ++$i) { my $solvable = $self->providers_get($rel, $i);
-- Olaf Dabrunz (od/odabrunz) SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
--- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Klaus Kaempf
-
Olaf Dabrunz