From: Frank Lichtenheld Date: Fri, 24 Feb 2006 00:36:27 +0000 (+0000) Subject: Some fixes to archive handling X-Git-Tag: switch-to-templates~40 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=33c3adfb631d4c1fb6690a02117674a984d0e6ee;p=deb%2Fpackages.git Some fixes to archive handling --- diff --git a/bin/parse-packages b/bin/parse-packages index ca77fbc..ac5bd2c 100755 --- a/bin/parse-packages +++ b/bin/parse-packages @@ -121,14 +121,14 @@ for my $suite (@SUITES) { $priorities{$suite}{$data{priority}}++; my $pkgitem = "$archive $suite $data{'architecture'} ". "$section $subsection $data{'priority'} $data{'version'} $sdescr\0"; - my $previtem = $packages_small{$data{'package'}}{$suite}{$data{'architecture'}} - || $pkgitem; + my $previtem = ($packages_small{$data{'package'}}{$suite}{$data{'architecture'}} + ||= $pkgitem); $packages_small{$data{'package'}}{$suite}{$data{'architecture'}} = $pkgitem - if version_cmp($data{'version'}, (split /\s/o, $previtem)[6]) >= 0; - $previtem = $packages_small{$data{'package'}}{$suite}{'any'} - || $pkgitem; + if version_cmp($data{'version'}, (split /\s/o, $previtem)[6]) > 0; + $previtem = ($packages_small{$data{'package'}}{$suite}{'any'} + ||= $pkgitem); $packages_small{$data{'package'}}{$suite}{'any'} = $pkgitem - if version_cmp($data{'version'}, (split /\s/o, $previtem)[6]) >= 0; + if version_cmp($data{'version'}, (split /\s/o, $previtem)[6]) > 0; $sources_packages{$src} .= "$archive $suite $data{'package'} $data{'version'} $data{'architecture'}\000"; $data{archive} = $archive; diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index 866bbc0..0ff2e9b 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -172,7 +172,7 @@ sub do_search { $subsect{$pkg}{$suite}{$version} = $subsection; $sect{$pkg}{$suite}{$version} = $section unless $section eq 'main'; - $archives{$pkg}{$suite}{$version} = $archive; + $archives{$pkg}{$suite}{$version} ||= $archive; $desc{$pkg}{$suite}{$version} = $desc; } else { diff --git a/lib/Packages/Page.pm b/lib/Packages/Page.pm index 417c97e..3eb3198 100644 --- a/lib/Packages/Page.pm +++ b/lib/Packages/Page.pm @@ -134,10 +134,6 @@ sub merge_package { foreach my $key (@TAKE_NEWEST) { $self->{data}{$key} = $data->{$key}; } - } elsif (($cmp == 0) && - $self->{data}{archive} ne 'us') { - #FIXME crude hack to prefer us archive over others - $self->{data}{archive} = $data->{archive}; } debug( "is_newest= ".($is_newest||0), 3 ) if DEBUG; if (!$self->{versions}{$data->{architecture}}