X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoFilelist.pm;h=ee092e3163ccc1e7afbea4be8eb7a4779925db07;hb=e9e5399ad699b724ed7d236b43f76b3ff85050bd;hp=7fb1a8fd5456f7ca330db521a9a77881846456bc;hpb=56d4b3ed57e20359e5ea46feabb850cf4a94caf2;p=deb%2Fpackages.git diff --git a/lib/Packages/DoFilelist.pm b/lib/Packages/DoFilelist.pm index 7fb1a8f..ee092e3 100644 --- a/lib/Packages/DoFilelist.pm +++ b/lib/Packages/DoFilelist.pm @@ -4,20 +4,15 @@ use strict; use warnings; use POSIX; -use URI::Escape; -use HTML::Entities; use DB_File; -use Benchmark ':hireswallclock'; use Exporter; use Deb::Versions; use Packages::Config qw( $DBDIR $ROOT @SUITES @ARCHIVES @SECTIONS @ARCHITECTURES %FTP_SITES ); -use Packages::I18N::Locale; use Packages::CGI; use Packages::DB; use Packages::Search qw( :all ); -use Packages::HTML; use Packages::Page (); use Packages::SrcPage (); @@ -25,48 +20,44 @@ our @ISA = qw( Exporter ); our @EXPORT = qw( do_filelist ); sub do_filelist { - my ($params, $opts, $html_header, $menu, $page_content) = @_; + my ($params, $opts, $page_content) = @_; + my $cat = $opts->{cat}; if ($params->{errors}{package}) { - fatal_error( _( "package not valid or not specified" ) ); + fatal_error( $cat->g( "package not valid or not specified" ) ); } if ($params->{errors}{suite}) { - fatal_error( _( "suite not valid or not specified" ) ); + fatal_error( $cat->g( "suite not valid or not specified" ) ); } if ($params->{errors}{arch}) { - fatal_error( _( "architecture not valid or not specified" ) ); + fatal_error( $cat->g( "architecture not valid or not specified" ) ); } - $$menu = ''; my $pkg = $opts->{package}; my $suite = $opts->{suite}[0]; my $arch = $opts->{arch}[0] ||''; - - %$html_header = ( title => sprintf( _( "Filelist of package %s in %s of architecture %s" ), $pkg, $suite, $arch ), - title_tag => sprintf( _( "Filelist of of package %s/%s/%s" ), $pkg, $suite, $arch ), - lang => $opts->{lang}, - keywords => "debian, $suite, $arch, filelist", - print_title => 1, - ); + $page_content->{pkg} = $pkg; + $page_content->{suite} = $suite; + $page_content->{arch} = $arch; unless (@Packages::CGI::fatal_errors) { if (tie my %contents, 'DB_File', "$DBDIR/contents/filelists_${suite}_${arch}.db", O_RDONLY, 0666, $DB_BTREE) { unless (exists $contents{$pkg}) { - fatal_error( _( "No such package in this suite on this architecture." ) ); + fatal_error( $cat->g( "No such package in this suite on this architecture." ) ); } else { my @files = unpack "L/(CC/a)", $contents{$pkg}; - my $file = ""; - $$page_content .= '
';
+		my $file = '';
+
+		$page_content->{files} = [];
 		for (my $i=0; $i{files}}, "/$file";
 		}
-		$$page_content .= '
'; } } else { - fatal_error( _( "Invalid suite/architecture combination" ) ); + fatal_error( $cat->g( "Invalid suite/architecture combination" ) ); } } }