diff options
author | Francois Pons <fpons@mandriva.com> | 2002-08-23 13:06:08 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-08-23 13:06:08 +0000 |
commit | 351cb5fbce6d663fc57b3f4662762737d913f116 (patch) | |
tree | 160919ee1ec7bb0b1be113e995005b003214c2ea | |
parent | be7994d2fd461c3594afb4bad5e0ef7276594a3b (diff) | |
download | perl-URPM-0.70.tar perl-URPM-0.70.tar.gz perl-URPM-0.70.tar.bz2 perl-URPM-0.70.tar.xz perl-URPM-0.70.zip |
0.70-1mdk.0.70
-rw-r--r-- | URPM.pm | 37 | ||||
-rw-r--r-- | perl-URPM.spec | 7 |
2 files changed, 38 insertions, 6 deletions
@@ -22,16 +22,45 @@ sub search { my ($urpm, $name, %options) = @_; my $best = undef; - foreach (keys %{$urpm->{provides}{$name} || {}}) { + #- tries other alternative if no strict searching. + unless ($options{strict}) { + if ($name =~ /^(.*)-([^\-]*)-([^\-]*)\.([^\.\-]*)$/) { + foreach (keys %{$urpm->{provides}{$1} || {}}) { + my $pkg = $urpm->{depslist}[$_]; + $pkg->fullname eq $name and return $pkg; + } + } + if ($name =~ /^(.*)-([^\-]*)-([^\-]*)$/) { + foreach (keys %{$urpm->{provides}{$1} || {}}) { + my $pkg = $urpm->{depslist}[$_]; + my ($n, $v, $r, $a) = $pkg->fullname; + $options{src} && $a eq 'src' || $pkg->is_arch_compat or next; + $n eq $1 or next; + !$best || $pkg->compare_pkg($best) > 0 and $best = $pkg; + } + $best and return $best; + } + if ($name =~ /^(.*)-([^\-]*)$/) { + foreach (keys %{$urpm->{provides}{$1} || {}}) { + my $pkg = $urpm->{depslist}[$_]; + my ($n, $v, $r, $a) = $pkg->fullname; + $options{src} && $a eq 'src' || $pkg->is_arch_compat or next; + $n eq $1 or next; + !$best || $pkg->compare_pkg($best) > 0 and $best = $pkg; + } + $best and return $best; + } + } + + foreach (keys %{$urpm->{provides}{$_} || {}}) { my $pkg = $urpm->{depslist}[$_]; my ($n, $v, $r, $a) = $pkg->fullname; - $options{src} && $a eq 'src' || $pkg->is_arch_compat or next; - $n eq $name || !$options{strict} && ("$n-$v" eq $name || "$n-$v-$r" eq $name || "$n-$v-$r.$a" eq $name) or next; + $n eq $name or next; !$best || $pkg->compare_pkg($best) > 0 and $best = $pkg; } - $best; + return $best; } sub traverse { diff --git a/perl-URPM.spec b/perl-URPM.spec index 2ed806e..06925e9 100644 --- a/perl-URPM.spec +++ b/perl-URPM.spec @@ -1,7 +1,7 @@ %define name perl-URPM %define real_name URPM -%define version 0.60 -%define release 8mdk +%define version 0.70 +%define release 1mdk %{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)} @@ -48,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Aug 23 2002 François Pons <fpons@mandrakesoft.com> 0.70-1mdk +- fixed search method to work correctly. + * Tue Aug 13 2002 François Pons <fpons@mandrakesoft.com> 0.60-8mdk - fixed request_packages_to_upgrade no more working correctly. |