Subject: | method urpm->search() doesn't work for SRPM synthesis |
Bug is in URPM.pm version 3.40.2
It seems method urpm->search() doesn't work properly for SRPM medias.
my $synthesis = "mrc_mystruct/i586/media/media_info/synthesis.hdlist_main_release.src.cz";
my $urpm = new URPM;
$urpm->parse_synthesis($synthesis);
my $res = $urpm->search('a52dec', src => 1); # doesn't return anything
---
But there is such package:
$ zcat mrc_mystruct/i586/media/media_info/synthesis.hdlist_main_release.src.cz
@requires@chrpath
@summary@A free ATSC A/52 stream decoder library
@filesize@191430
@info@a52dec-0.7.4-18.mga3.src@0@189052@Video/Editors and Converters
---
I guess, the bug is in the following algorithm, that used in $urpm->search:
foreach my $pkg (packages_providing($urpm, $1)) {
my ($n, $v, undef, $a) = $pkg->fullname;
$options{src} && $a eq 'src' || $pkg->is_arch_compat or next;
"$n-$v" eq $name or next;
!$best || $pkg->compare_pkg($best) > 0 and $best = $pkg;
}
method $urpm->packages_providing() returns no items for SRPM package, because synthesis doesn't have "provides" section for SRPM packages and $urpm->{provides} hash is just empty for such medias.