1 package Packages::DoFilelist;
14 use Packages::Config qw( $DBDIR $ROOT @SUITES @ARCHIVES @SECTIONS
15 @ARCHITECTURES %FTP_SITES );
18 use Packages::Search qw( :all );
20 use Packages::Page ();
21 use Packages::SrcPage ();
23 our @ISA = qw( Exporter );
24 our @EXPORT = qw( do_filelist );
27 my ($params, $opts, $html_header, $menu, $page_content) = @_;
29 if ($params->{errors}{package}) {
30 fatal_error( "package not valid or not specified" );
32 if ($params->{errors}{suite}) {
33 fatal_error( "suite not valid or not specified" );
35 if ($params->{errors}{arch}) {
36 fatal_error( "arch not valid or not specified" );
40 my $pkg = $opts->{package};
41 my $suite = $opts->{suite}[0];
42 my $arch = $opts->{arch}[0] ||'';
44 %$html_header = ( title => "Filelist of package <em>$pkg</em> in <em>$suite</em> of arch <em>$arch</em>",
45 title_tag => "Filelist of of package $pkg/$suite/$arch",
47 keywords => "debian, $suite, $arch, filelist",
51 unless (@Packages::CGI::fatal_errors) {
52 if (tie my %contents, 'DB_File', "$DBDIR/contents/filelists_${suite}_${arch}.db",
53 O_RDONLY, 0666, $DB_BTREE) {
55 unless (exists $contents{$pkg}) {
56 fatal_error( "No such package in this suite on this arch" );
58 my @files = unpack "L/(CC/a)", $contents{$pkg};
60 $$page_content .= '<pre style="border-top:solid #BFC3DC thin;padding:.5em;">';
61 for (my $i=0; $i<scalar @files;) {
62 $file = substr($file, 0, $files[$i++]).$files[$i++];
63 $$page_content .= "$file\n";
65 $$page_content .= "</pre>";
68 fatal_error( "Invalid suite/arch combination" );