From: Frank Lichtenheld Date: Mon, 8 Oct 2007 00:07:58 +0000 (+0000) Subject: Merge commit 'origin/master' into debian-master X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=b8f8b8b28feef723740e0d3273b3c0c5371c6627;hp=8f5e2eeba9cc6f50e5251ba8b64d026086f13b7d;p=deb%2Fpackages.git Merge commit 'origin/master' into debian-master --- diff --git a/bin/parse-contents b/bin/parse-contents index 36c90b1..414dc8a 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -18,6 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use strict; +use warnings; use lib './lib'; $| = 1; @@ -103,9 +104,11 @@ for my $suite (@suites) { $packages_contents_lastword{$_} = "$file\0"; } # Searches are case-insensitive - $file =~ tr [A-Z] [a-z]; - - print REVERSED (reverse $file)."\0".(join ":$arch\0", @packages).":$arch\n"; + (my $nocase = $file) =~ tr [A-Z] [a-z]; + my $case = ($nocase eq $file) ? '-' : $file; + + print REVERSED (reverse $nocase)."\0".$case."\0". + (join ":$arch\0", @packages).":$arch\n"; } close CONT; @@ -130,7 +133,7 @@ for my $suite (@suites) { rename("$DBDIR/reverse.tmp", "$DBDIR/reverse_${suite}_${arch}.txt"); rename("$filelist_db.new", $filelist_db); - system("ln -sf $filelist_db $DBDIR/filelists_${suite}_all.db") == 0 + system("ln", "-sf", $filelist_db, "$DBDIR/filelists_${suite}_all.db") == 0 or die "Oops"; } } @@ -145,26 +148,33 @@ for my $suite (@suites) { print "Merging reverse path lists for ${suite}...\n"; - open MERGED, "sort -m $DBDIR/reverse_${suite}_*.txt |" + open MERGED, "-|", "sort -m $DBDIR/reverse_${suite}_*.txt" or die "Failed to open merged list"; - open FILENAMES, "> $DBDIR/filenames_$suite.txt.new" + open FILENAMES, ">", "$DBDIR/filenames_$suite.txt.new" or die "Failed to open filenames list"; tie my %reverse_path_db, "DB_File", "$DBDIR/reverse_${suite}.db.new", O_RDWR|O_CREAT, 0666, $DB_BTREE or die "Error creating DB: $!"; - my $lastpath = ""; - my $lastfile = ""; - my @matches = (); + my $lastpath = my $lastcasepath = my $lastfile = ""; + my %matches = (); while () { print "Doing line ".($./1000000)."M (out of approx. 16M)\n" if $. % 1000000 == 0; chomp; my @line = split /\0/o, $_; my $revpath = shift @line; + my $casepath = shift @line; if ($revpath ne $lastpath) { # Wrap: Do useful stuff with this ($lastpath, @matches) - $reverse_path_db{$lastpath} = join "\0", @matches if $lastpath ne ""; + if ($lastpath ne "") { + my @matches; + while (my ($k, $v) = each %matches) { + push @matches, join("\0", $k, @$v); + } + $reverse_path_db{$lastpath} = join "\1", @matches; + %matches = (); + } $lastpath =~ s,/.*,,o; if ($lastfile ne $lastpath) { $lastfile = $lastpath; @@ -172,15 +182,24 @@ for my $suite (@suites) { } # $lastpath = $revpath; - @matches = @line; + $lastcasepath = $casepath; + $matches{$casepath} = \@line; next; +# } elsif ($lastcasepath ne "" and $casepath ne $lastcasepath) { +# warn reverse($revpath)." has more than one casepath: $casepath $lastcasepath\n"; } - push @matches, @line - } + push @{$matches{$casepath}}, @line; + } # Note: do useful stuff here too, for out last entry. Maybe prevent this by # adding a fake ultimate entry? - $reverse_path_db{$lastpath} = join "\0", @matches; - + { + my @matches; + while (my ($k, $v) = each %matches) { + push @matches, join("\0", $k, @$v); + } + $reverse_path_db{$lastpath} = join "\1", @matches; + } + untie %reverse_path_db; close FILENAMES; close MERGED; diff --git a/cron.d/050checkinst b/cron.d/050checkinst index fff0088..7a5b6c6 100755 --- a/cron.d/050checkinst +++ b/cron.d/050checkinst @@ -3,7 +3,7 @@ # Test whether all required packages are installed and generate a mail # if they aren't, so that the admin is informed. -required="subversion gettext locales rsync dpkg-dev procmail" +required="git-core gettext locales rsync dpkg-dev procmail" required="$required libcompress-zlib-perl" required="$required libhtml-parser-perl libio-stringy-perl" required="$required liblocale-gettext-perl libmldbm-perl" diff --git a/lib/Packages/CGI.pm b/lib/Packages/CGI.pm index b15e9ed..beb4e25 100644 --- a/lib/Packages/CGI.pm +++ b/lib/Packages/CGI.pm @@ -26,11 +26,11 @@ sub get_mime { return $mime_types{$_[0]} || $_[1] || 'text/html'; } -our (@fatal_errors, @errors, @debug, @msgs, @hints, @notes); +our (@fatal_errors, @errors, @debug, @hints); our $http_code; sub reset { - @fatal_errors = @errors = @debug = @msgs = @hints = @notes = (); + @fatal_errors = @errors = @debug = @hints = (); $http_code = 200; } @@ -48,27 +48,17 @@ sub debug { my $lvl = $_[1] || 0; push(@debug, $_[0]) if $debug > $lvl; } -sub msg { - push @msgs, $_[0]; -} -sub note { - push @notes, [ @_ ]; -} sub get_errors { (@fatal_errors, @errors) } sub get_debug { return unless $debug && @debug; return @debug; } -sub get_msgs { @msgs }; sub get_hints { @hints }; -sub get_notes { @notes }; sub get_all_messages { return { errors => [ @fatal_errors, @errors ], debugs => $debug ? \@debug : [], - msgs => \@msgs, hints => \@hints, - notes => \@notes, }; } @@ -98,7 +88,7 @@ sub parse_params { foreach my $param ( keys %params ) { - debug( "Param $param", 2 ) if DEBUG; + debug( "Param $param", 2 ) if DEBUG; my $p_value_orig = $cgi->param($param); diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index 1be7d44..debbbb2 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -173,8 +173,15 @@ sub searchfile last unless index($key, $kw) == 0; debug( "found $key", 2 ) if DEBUG; - my @hits = split /\0/o, $value; - push @$results, [ scalar reverse($key), @hits ]; + my @files = split /\001/o, $value; + foreach my $f (@files) { + my @hits = split /\0/o, $f; + my $file = shift @hits; + if ($file eq '-') { + $file = reverse($key); + } + push @$results, [ $file, @hits ]; + } last if ($$nres)++ > 100; } diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 30158c5..51c97e7 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -14,7 +14,7 @@ use Deb::Versions; use Packages::Config qw( $DBDIR @SUITES @ARCHIVES @SECTIONS @ARCHITECTURES %FTP_SITES @DDTP_LANGUAGES); use Packages::I18N::Locale; -use Packages::CGI qw( :DEFAULT make_url make_search_url note ); +use Packages::CGI qw( :DEFAULT make_url make_search_url ); use Packages::DB; use Packages::Search qw( :all ); use Packages::Page (); @@ -68,8 +68,8 @@ sub do_show { } unless (@results || @non_results ) { - fatal_error( _g( "No such package." )."
". - sprintf( _g( 'Search for the package' ), make_search_url('','keywords='.uri_escape($pkg)) ) ); + fatal_error( _g( "No such package.") ); + #sprintf( _g( 'Search for the package' ), make_search_url('','keywords='.uri_escape($pkg)) ) ); } else { my %all_suites; foreach (@results, @non_results) { diff --git a/static/packages-site.css b/static/packages-site.css index 8d61a6c..270098d 100644 --- a/static/packages-site.css +++ b/static/packages-site.css @@ -1,3 +1,3 @@ -.oldstable-volatile, .oldstable-backports, .etch-m68k, .stable-backports { +.sarge-volatile, .sarge-backports, .etch-m68k, .etch-backports { font-size: smaller; } diff --git a/static/packages.css.sed.in b/static/packages.css.sed.in index 9e09dd8..7a4d9d3 100644 --- a/static/packages.css.sed.in +++ b/static/packages.css.sed.in @@ -137,16 +137,6 @@ h1 { margin: 0; clear: both; } -.pnotes { - margin: .2em; - padding: .5em; - border: solid thin black; - background-color: #bdf; - clear: both; -} -.pnotes h2 { - color: red; -} .pconstantnag { max-width: 60em; border: dotted thin red; diff --git a/templates/html/messages.tmpl b/templates/html/messages.tmpl index 7c9c611..3faa76d 100644 --- a/templates/html/messages.tmpl +++ b/templates/html/messages.tmpl @@ -14,18 +14,3 @@

[% hint | html %]

[% '' IF loop.last -%] [% END -%] -[%- FOREACH msg IN msgs %] -[%- '
' IF loop.first %] -

[% msg | html %]

-[% '
' IF loop.last -%] -[% END -%] -[%- FOREACH note IN notes %] -[%- '
' IF loop.first %] -[%- IF note.1 %] -

[% note.0 | html %]

-

[% note.1 | html %]

-[% ELSE %] -

[% note.0 | html %]

-[% END -%] -[% '
' IF loop.last -%] -[% END -%]