use Packages::Config qw( $DBDIR @SUITES @ARCHIVES @SECTIONS
@ARCHITECTURES %FTP_SITES
@LANGUAGES @DDTP_LANGUAGES);
-use Packages::I18N::Locale;
use Packages::CGI qw( :DEFAULT make_url make_search_url );
use Packages::DB;
use Packages::Search qw( :all );
sub do_show {
my ($params, $opts, $page_contents) = @_;
+ my $cat = $opts->{cat};
if ($params->{errors}{package}) {
- fatal_error( _g( "package not valid or not specified" ) );
+ fatal_error( $cat->g( "package not valid or not specified" ) );
}
if ($params->{errors}{suite}) {
- fatal_error( _g( "suite not valid or not specified" ) );
+ fatal_error( $cat->g( "suite not valid or not specified" ) );
}
if (@{$opts->{suite}} > 1) {
- fatal_error( sprintf( _g( "more than one suite specified for show (%s)" ), "@{$opts->{suite}}" ) );
+ fatal_error( $cat->g( "more than one suite specified for show (%s)",
+ "@{$opts->{suite}}" ) );
}
my %contents;
}
unless (@results || @non_results ) {
- fatal_error( _g( "No such package.") );
+ fatal_error( $cat->g( "No such package.") );
#sprintf( _g( '<a href="%s">Search for the package</a>' ), make_search_url('','keywords='.uri_escape($pkg)) ) );
} else {
my %all_suites;
$contents{suites} = [ suites_sort(keys %all_suites) ];
unless (@results) {
- fatal_error( _g( "Package not available in this suite." ) );
+ fatal_error( $cat->g( "Package not available in this suite." ) );
} else {
$contents{page} = $page;
unless ($opts->{source}) {
my $v_str = $version;
my $multiple_versions = grep { $_ ne $version } values %$versions;
- $v_str .= _g(" and others") if $multiple_versions;
+ $v_str .= $cat->g(" and others") if $multiple_versions;
$contents{versions} = { short => $v_str,
multiple => $multiple_versions };
my $provided_by = $page->{provided_by};
$contents{providers} = [];
- pkg_list( \%packages, $opts, $provided_by, 'en', $contents{providers} ) if $provided_by;
+ pkg_list( \%packages, $opts, $provided_by, $contents{providers} ) if $provided_by;
#
# display dependencies
search => 1 );
} else { # unless $page->is_virtual
$contents{is_virtual} = 1;
- $contents{desc}{short} = _g( "virtual package" );
+ $contents{desc}{short} = $cat->g( "virtual package" );
$contents{subsection} = 'virtual';
my $provided_by = $page->{provided_by};
$contents{providers} = [];
- pkg_list( \%packages, $opts, $provided_by, 'en', $contents{providers} );
+ pkg_list( \%packages, $opts, $provided_by, $contents{providers} );
} # else (unless $page->is_virtual)
} else { # unless $opts->{source}
my $binaries = find_binaries( $pkg, $archive, $suite, \%src2bin );
if ($binaries && @$binaries) {
$contents{binaries} = [];
- pkg_list( \%packages, $opts, $binaries, 'en', $contents{binaries} );
+ pkg_list( \%packages, $opts, $binaries, $contents{binaries} );
}
#
if ($info{sourcedownload}) {
$contents->{src}{url} = make_url($source,'',{source=>'source'});
$contents->{src}{pkg} = $source;
+ $contents->{src}{version} = $source_version;
my @downloads;
my $files = $page->get_src( 'files' );
'suggests' => 'sug', 'build-depends' => 'adep',
'build-depends-indep' => 'idep' );
my $suite = $opts->{suite}[0];
+ my $cat = $opts->{cat};
my %out = ( id => $dep_type{$type}, terms => [] );
if ($arch_str ||= '') {
if ($arch_neg) {
- $arch_str = sprintf( _g("not %s"), "$arch_str" );
+ $arch_str = $cat->g("not %s", "$arch_str" );
} else {
$arch_str = $arch_str;
}
my $entry = $entries{$p_name} ||
read_entry_simple( $packages, $p_name, $opts->{h_archives}, $suite);
my $short_desc = $entry->[-1];
- my $desc_md5 = $entry->[-2];
+ my $desc_md5 = $entry->[-2] || '';
my $arch = $entry->[3];
my $archive = $entry->[1];
my $p_suite = $entry->[2];
}
} elsif ( $rel_out{is_old_pkgs} ) {
} else {
- $rel_alt_out{desc} = _g( "Package not available" );
+ $rel_alt_out{desc} = $cat->g( "Package not available" );
$rel_alt_out{suite} = '';
}
push @{$rel_out{alternatives}}, \%rel_alt_out;
} # end print_deps
sub pkg_list {
- my ( $packages, $opts, $pkgs, $lang, $list ) = @_;
+ my ( $packages, $opts, $pkgs, $list ) = @_;
my $suite = $opts->{suite}[0];
foreach my $p ( sort @$pkgs ) {
push @$list, { name => $p, desc => $short_desc,
trans_desc => \%sdescs, available => 1 };
} else {
- push @$list, { name => $p, desc => _g("Not available") };
+ push @$list, { name => $p,
+ desc => $opts->{cat}->g("Not available") };
}
}
}