diff options
author | Francois Pons <fpons@mandriva.com> | 2002-12-17 13:46:47 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-12-17 13:46:47 +0000 |
commit | 3b15f4893480acf473e276c571a1eda577621c72 (patch) | |
tree | 86ebcc6e19fb4cd196d4c114c328a2a492aef056 /URPM.pm | |
parent | ccd1e1188079c523a84c5a3a6806d21669539e21 (diff) | |
download | perl-URPM-3b15f4893480acf473e276c571a1eda577621c72.tar perl-URPM-3b15f4893480acf473e276c571a1eda577621c72.tar.gz perl-URPM-3b15f4893480acf473e276c571a1eda577621c72.tar.bz2 perl-URPM-3b15f4893480acf473e276c571a1eda577621c72.tar.xz perl-URPM-3b15f4893480acf473e276c571a1eda577621c72.zip |
0.81-1mdk
Diffstat (limited to 'URPM.pm')
-rw-r--r-- | URPM.pm | 64 |
1 files changed, 34 insertions, 30 deletions
@@ -6,7 +6,7 @@ use vars qw($VERSION @ISA); require DynaLoader; @ISA = qw(DynaLoader); -$VERSION = '0.80'; +$VERSION = '0.81'; bootstrap URPM $VERSION; @@ -80,11 +80,12 @@ sub traverse_tag { my ($count, %names) = (0); if (@{$names || []}) { - @names{@$names} = (); if ($tag eq 'name') { - foreach (@{$urpm->{depslist} || []}) { - if (exists $names{$_->name}) { - $callback and $callback->($_); + foreach my $n (@$names) { + foreach (keys %{$urpm->{provides}{$n} || {}}) { + my $p = $urpm->{depslist}[$_]; + $p->name eq $n or next; + $callback and $callback->($p); ++$count; } } @@ -95,36 +96,39 @@ sub traverse_tag { ++$count; } } - } elsif ($tag eq 'whatrequires') { - foreach (@{$urpm->{depslist} || []}) { - if (grep { /^([^ \[]*)/ && exists $names{$1} } $_->requires) { - $callback and $callback->($_); - ++$count; + } else { + @names{@$names} = (); + if ($tag eq 'whatrequires') { + foreach (@{$urpm->{depslist} || []}) { + if (grep { /^([^ \[]*)/ && exists $names{$1} } $_->requires) { + $callback and $callback->($_); + ++$count; + } } - } - } elsif ($tag eq 'whatconflicts') { - foreach (@{$urpm->{depslist} || []}) { - if (grep { /^([^ \[]*)/ && exists $names{$1} } $_->conflicts) { - $callback and $callback->($_); - ++$count; + } elsif ($tag eq 'whatconflicts') { + foreach (@{$urpm->{depslist} || []}) { + if (grep { /^([^ \[]*)/ && exists $names{$1} } $_->conflicts) { + $callback and $callback->($_); + ++$count; + } } - } - } elsif ($tag eq 'group') { - foreach (@{$urpm->{depslist} || []}) { - if (exists $names{$_->group}) { - $callback and $callback->($_); - ++$count; + } elsif ($tag eq 'group') { + foreach (@{$urpm->{depslist} || []}) { + if (exists $names{$_->group}) { + $callback and $callback->($_); + ++$count; + } } - } - } elsif ($tag eq 'triggeredby' || $tag eq 'path') { - foreach (@{$urpm->{depslist} || []}) { - if (grep { exists $names{$_} } $_->files, grep { /^\// } $_->provides_nosense) { - $callback and $callback->($_); - ++$count; + } elsif ($tag eq 'triggeredby' || $tag eq 'path') { + foreach (@{$urpm->{depslist} || []}) { + if (grep { exists $names{$_} } $_->files, grep { /^\// } $_->provides_nosense) { + $callback and $callback->($_); + ++$count; + } } + } else { + die "unknown tag"; } - } else { - die "unknown tag"; } } |