]> git.deb.at Git - deb/packages.git/commitdiff
Merge commit 'origin/master' into debian-master
authorFrank Lichtenheld <frank@lichtenheld.de>
Mon, 8 Oct 2007 00:07:58 +0000 (00:07 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Mon, 8 Oct 2007 00:07:58 +0000 (00:07 +0000)
bin/parse-contents
cron.d/050checkinst
lib/Packages/CGI.pm
lib/Packages/DoSearchContents.pm
lib/Packages/DoShow.pm
static/packages-site.css
static/packages.css.sed.in
templates/html/messages.tmpl

index 36c90b1479fd54e937d80c21601e94dcd1f87532..414dc8ac0a623c1f11e04154423881f033478cc7 100755 (executable)
@@ -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 (<MERGED>) {
        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;
index fff00880bc47b74581e1f4ecd1a5b87f69ffee00..7a5b6c6d1b0c08fe4cf0e282d45fb6a60cef8037 100755 (executable)
@@ -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"
index b15e9edc63162da758865f07f4607bc8a6cf90f7..beb4e255e9844bc68b4a32006db528e1354e9bd6 100644 (file)
@@ -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 <strong>$param</strong>", 2 ) if DEBUG;
+       debug( "Param $param", 2 ) if DEBUG;
 
        my $p_value_orig = $cgi->param($param);
 
index 1be7d441cc90e25c6da65a0b855a2916d809e8ff..debbbb2a93e28539aef61f66556ae17871080c85 100644 (file)
@@ -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;
     }
 
index 30158c54b42d35ce6f5dcc91e8b008aac502efb3..51c97e72d0e562127ee14d575457cfcc6d028313 100644 (file)
@@ -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." )."<br>".
-                        sprintf( _g( '<a href="%s">Search for the package</a>' ), make_search_url('','keywords='.uri_escape($pkg)) ) );
+           fatal_error( _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;
            foreach (@results, @non_results) {
index 8d61a6c3a6d1c2b392ea409aa743e8beae95d384..270098d81748a178b90b39cd774be1464fa03c3b 100644 (file)
@@ -1,3 +1,3 @@
-.oldstable-volatile, .oldstable-backports, .etch-m68k, .stable-backports {
+.sarge-volatile, .sarge-backports, .etch-m68k, .etch-backports {
        font-size: smaller;
 }
index 9e09dd8192208d8f42abc3c0425e02e63662a5ee..7a4d9d3184b62c6e0324da6ea15415312ba78d7f 100644 (file)
@@ -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;
index 7c9c6117700d817f0467fd22be9e784b630a9191..3faa76d97faf8b49fa31201851b99fa9bdc21fc6 100644 (file)
  <p>[% hint | html %]</p>
 [% '</div>' IF loop.last -%]
 [% END -%]
-[%- FOREACH msg IN msgs %]
-[%- '<div class="pmsgs">' IF loop.first %]
- <p>[% msg | html %]</p>
-[% '</div>' IF loop.last -%]
-[% END -%]
-[%- FOREACH note IN notes %]
-[%- '<div class="pnotes">' IF loop.first %]
-[%- IF note.1 %]
- <h2>[% note.0 | html %]</h2>
- <p>[% note.1 | html %]</p>
-[% ELSE %]
- <p>[% note.0 | html %]</p>
-[% END -%]
-[% '</div>' IF loop.last -%]
-[% END -%]