]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoDownload.pm
Packages::I18N::*: Add some missing definitions for Khmer
[deb/packages.git] / lib / Packages / DoDownload.pm
index d999b9a042d6d06853c4ab9652e1bf4e68d9cf07..bb7d073795861a4f1e95d10298b0caca76d1ce67 100644 (file)
@@ -72,11 +72,11 @@ sub do_download {
            
            debug( "final_result=@$final_result", 1 );
            $archive = $final_result->[1];
-           my %data = split /\000/, $packages_all{"$pkg $arch $final_result->[7]"};
+           my %data = split(/\000/, $packages_all{"$pkg $arch $final_result->[7]"}||'');
            if (!%data && $arch ne 'all' && $final_result->[3] eq 'all') {
                %data = split /\000/, $packages_all{"$pkg all $final_result->[7]"};
-               $arch = 'all';
                debug( "choosing arch 'all' instead of requested arch $arch", 1 );
+               $arch = 'all';
 #              fatal_error( _g( "No such package." )."<br>".
 #                           sprintf( _g( '<a href="%s">Search for the package</a>' ), "$SEARCH_URL/$pkg" ) ) unless %data;
            }
@@ -89,10 +89,10 @@ sub do_download {
            $page_content->{pkg} = $pkg;
            my $pkgsize = floor(($data{size}/102.4)+0.5)/10;
            if ($pkgsize < 1024) {
-               $page_content->{pkgsize} = sprintf( '%.1f', $pkgsize );
+               $page_content->{pkgsize} = $pkgsize;
                $page_content->{pkgsize_unit} = $cat->g( 'kByte' );
            } else {
-               $page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/(102.4*102.4))+0.5)/100 );
+               $page_content->{pkgsize} = floor(($data{size}/(102.4*102.4))+0.5)/100;
                $page_content->{pkgsize_unit} = $cat->g( 'MByte' );
            }
            $page_content->{architecture} = $arch;