From 651d6771851fd3218410277158fae740b570cef6 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 12 Apr 2007 23:05:06 +0200 Subject: [PATCH 01/16] dispatcher: Allow to use 'any' as an architecture name This will not set the arch parameter since it is essentially a no-op anyway --- cgi-bin/dispatcher.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 11a1d59..754e9b0 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -125,7 +125,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { sid => 'unstable', ); my %SECTIONS = map { $_ => 1 } @SECTIONS; my %ARCHIVES = map { $_ => 1 } @ARCHIVES; - my %ARCHITECTURES = map { $_ => 1 } (@ARCHITECTURES, 'all'); + my %ARCHITECTURES = map { $_ => 1 } (@ARCHITECTURES, 'all', 'any'); my %PRIORITIES = map { $_ => 1 } @PRIORITIES; my %params_set; sub set_param_once { @@ -158,7 +158,8 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { } elsif (!$need_pkg && ($_ eq 'source')) { set_param_once( $input, \%params_set, 'source', 1); } elsif ($ARCHITECTURES{$_}) { - set_param_once( $input, \%params_set, 'arch', $_); + set_param_once( $input, \%params_set, 'arch', $_) + unless $_ eq 'any'; } elsif ($PRIORITIES{$_}) { set_param_once( $input, \%params_set, 'priority', $_); } else { -- 2.39.2 From a11abc0a5f37aae82381d49bfe8ab8b00f48f238 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 12 Apr 2007 23:36:49 +0200 Subject: [PATCH 02/16] index.tmpl: Fix two bugs One missing semicolon added. One variable named corrected (navigation_pre -> nav_arr) --- templates/html/index.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/html/index.tmpl b/templates/html/index.tmpl index dc44e99..9daa9a5 100644 --- a/templates/html/index.tmpl +++ b/templates/html/index.tmpl @@ -8,7 +8,7 @@ nav_last = { prefix=>"$category.id:", name=>category.name }; ELSE; nav_last = { name=>'All Packages' }; - END + END; nav_arr.push( { name=>'Source', url=>make_url('/','','suite',suite,'source',source) } ) IF source; @@ -18,7 +18,7 @@ title_tag = title_common page_title = title_common keywords = "$suite, $category.name" - navigation = navigation_pre + navigation = nav_arr %] [% FOREACH packages %] -- 2.39.2 From 5ca559979f5074ae784d83a401b7dcb51e98317d Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 12 Apr 2007 23:52:55 +0200 Subject: [PATCH 03/16] Page.pm: Let get_version_string sort architectures alphabetically --- lib/Packages/Page.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Packages/Page.pm b/lib/Packages/Page.pm index 7c3ed67..27c3f36 100644 --- a/lib/Packages/Page.pm +++ b/lib/Packages/Page.pm @@ -243,7 +243,7 @@ sub get_version_string { my @v_str_arch; foreach ( @versions ) { push @v_str, [ $_, $versions->{$_} ]; - push @v_str_arch, "$_ [".join(', ', @{$versions->{$_}})."]"; + push @v_str_arch, "$_ [".join(', ', sort @{$versions->{$_}})."]"; } $v_str_arch = join( ", ", @v_str_arch ); $v_str = join( ", ", @versions ); -- 2.39.2 From 08faf198729da5a356e83e4e435af30828ac9616 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 00:28:58 +0200 Subject: [PATCH 04/16] dispatcher: Fix HTTP error code for "format not supported" 405 is actually the error for not supported HTTP request (i.e. GET, POST, etc). 406 is the correct code for content formats. --- cgi-bin/dispatcher.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 754e9b0..1f876de 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -261,7 +261,7 @@ my $template = new Packages::Template( $TEMPLATEDIR, $opts{format}, { lang => $o unless (-e "$TEMPLATEDIR/$opts{format}/${what_to_do}.tmpl") { fatal_error( "requested format not available for this document", - "405 requested format not available"); + "406 requested format not available"); } my (%html_header, %page_content); -- 2.39.2 From 7e6d64d532662ea5d33962a234e2847c882e96ee Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 01:46:25 +0200 Subject: [PATCH 05/16] architectures.tmpl: Change MIPS architecture names MIPS -> MIPS (big-endian) MIPS (DEC) -> MIPS (little-endian) This ports a change recently made to the Debian webpage. The DEC is a historical name that may confuse newer users. --- templates/config/architectures.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/config/architectures.tmpl b/templates/config/architectures.tmpl index c15e8be..94523fa 100644 --- a/templates/config/architectures.tmpl +++ b/templates/config/architectures.tmpl @@ -9,8 +9,8 @@ architectures = { arm => 'ARM', hppa => 'HP PA-RISC', ia64 => 'Intel IA-64', - mips => 'MIPS', - mipsel => 'MIPS (DEC)', + mips => 'MIPS (big-endian)', + mipsel => 'MIPS (little-endian)', s390 => 'IBM S/390', "hurd-i386" => 'Hurd (i386)', amd64 => 'AMD64', -- 2.39.2 From fbaec1642d4253bb594546c6f8a3204e093c1443 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 01:47:38 +0200 Subject: [PATCH 06/16] search_contents.tmpl: Don't offer a link to the search with the same suite Since that is essentially a link to the page the user is looking at. --- templates/html/search_contents.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/html/search_contents.tmpl b/templates/html/search_contents.tmpl index ed369e5..77836fe 100644 --- a/templates/html/search_contents.tmpl +++ b/templates/html/search_contents.tmpl @@ -44,7 +44,11 @@

Search in other suite: [% FOREACH s IN all_suites %] -[[% s %]] + [% IF s != suite %] + [[% s %]] + [% ELSE %] + [[% s %]] + [% END %] [% END %] [% UNLESS search_architectures.size == 1 || all_architectures.size == 1 %] -- 2.39.2 From 8753cac7a1334aaaf74690e3ff4d5c318fe2aefb Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 01:52:20 +0200 Subject: [PATCH 07/16] static: Add a simple index page and use ttree to build and install Add a simple index page to static that we can use as homepage if we don't want to redirect to an external search form like we do on the official packages.debian.org. Also use ttree to build and install the contents of static. This allows to use TT for preprocessing. The first example of such a file is the added index file. --- conf/apache.conf.sed.in | 3 +- conf/ttreerc.sed.in | 17 +++++++ cron.d/700install_static | 2 +- static/index.tmpl | 107 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 conf/ttreerc.sed.in create mode 100644 static/index.tmpl diff --git a/conf/apache.conf.sed.in b/conf/apache.conf.sed.in index f1b62ab..594efd7 100644 --- a/conf/apache.conf.sed.in +++ b/conf/apache.conf.sed.in @@ -113,10 +113,11 @@ RewriteRule ^/[^/]+\.js - [L] # RewriteRule ^/$ http://www.debian.org/distrib/packages + RewriteRule ^/$ /index.html [L] RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N] RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE] - RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [PT] + RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT] # In case we need to disable the site again # diff --git a/conf/ttreerc.sed.in b/conf/ttreerc.sed.in new file mode 100644 index 0000000..2470689 --- /dev/null +++ b/conf/ttreerc.sed.in @@ -0,0 +1,17 @@ +recurse +verbose + +ignore = \b(CVS|RCS|\.git|\.svn)\b +ignore = ^# +ignore = ~$ +ignore = \.sed\.in$ + +copy = \.(gif|png|jpg|pdf|css|js)$ +accept = \.tmpl$ +suffix tmpl=html + +lib = %TOPDIR%/templates +src = %TOPDIR%/static +dest = %TOPDIR%/www + +pre_process = config.tmpl diff --git a/cron.d/700install_static b/cron.d/700install_static index f30a5e1..84b6864 100755 --- a/cron.d/700install_static +++ b/cron.d/700install_static @@ -6,4 +6,4 @@ set -e test -d "$htmldir" || mkdir -p "$htmldir" -rsync -aC "$staticdir/"* "$htmldir/" +cd "$topdir" && ttree -f ./conf/ttreerc diff --git a/static/index.tmpl b/static/index.tmpl new file mode 100644 index 0000000..cbf214f --- /dev/null +++ b/static/index.tmpl @@ -0,0 +1,107 @@ +[% PROCESS 'html/head.tmpl' + title_tag = "$organisation Packages Search" + page_title = "$organisation Packages Search" + keywords = "$organisation, Packages" +%] + + +

This site provides you with information about all the packages +available in the [% organisation %] +Package archive. + +

Please contact [% admin.name %] +if you encounter any problems!

+ +

Browse through the lists of packages:

+ +
    + +
+ + +

There is also a list of packages +recently added to unstable.

+ +

Search

+ +

Search package directories

+ +
+ + + +
+Search on: + +   + + + + + +
+Only show exact matches: + +
+Distribution: + +Section: + +
+

There are shortcuts for some searches available:

+
    +
  • [% packages_homepage %]/name for + the search on package names.
  • + +
  • [% packages_homepage %]/src:name + for the search on source package names.
  • +
+
+ +

Search the contents of packages

+ +

This search engine allows you to search the contents of [% organisation %] +distributions for any files (or just parts of file names) that are +part of packages. +You can also get a full list of files in a given package. +
+

+ + + +   + + +
+Display: +
+ + +
+ + +
+ + + + + + + + +
+ +[% PROCESS 'html/foot.tmpl' + langs.size = 0 %] -- 2.39.2 From 089a004ae30c4f2ffe436dcf89f819560465e6c3 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 01:56:08 +0200 Subject: [PATCH 08/16] syncarchive: add oldstable backports and volatile Also remove stable backports, since there are none for etch yet. --- config.sh.sed.in | 4 ++-- cron.d/100syncarchive_backports | 2 +- cron.d/100syncarchive_volatile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.sh.sed.in b/config.sh.sed.in index 7addf96..1868bce 100644 --- a/config.sh.sed.in +++ b/config.sh.sed.in @@ -28,7 +28,7 @@ cachedir=${topdir}/cache ftpsite=http://ftp.de.debian.org/debian nonus_ftpsite=http://ftp.uk.debian.org/debian-non-US security_ftpsite=http://security.debian.org/debian-security -volatile_ftpsite=http://volatile.debian.net/debian-volatile +volatile_ftpsite=http://volatile.debian.org/debian-volatile backports_ftpsite=http://backports.org/debian amd64_ftpsite=http://amd64.debian.net/debian #kfreebsd_ftpsite=http://kfreebsd-gnu.debian.net/debian @@ -43,7 +43,7 @@ ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk" archives="us security amd64 kfreebsd backports volatile" sections="main contrib non-free" parts="$sections" -suites="oldstable stable stable-volatile stable-backports testing unstable experimental" +suites="oldstable oldstable-volatile oldstable-backports stable stable-volatile stable-backports testing unstable experimental" priorities="required important standard optional extra" dists="$suites" architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc" diff --git a/cron.d/100syncarchive_backports b/cron.d/100syncarchive_backports index 7860f2b..6411eb1 100755 --- a/cron.d/100syncarchive_backports +++ b/cron.d/100syncarchive_backports @@ -7,7 +7,7 @@ cd ${archivedir} # backports archive # -for dist in stable +for dist in oldstable do echo "retrieve Release(.gpg) $dist-backports" test -d backports/${dist}-backports || mkdir -p backports/${dist}-backports diff --git a/cron.d/100syncarchive_volatile b/cron.d/100syncarchive_volatile index d62f7d2..b8cef9a 100755 --- a/cron.d/100syncarchive_volatile +++ b/cron.d/100syncarchive_volatile @@ -7,7 +7,7 @@ cd ${archivedir} # volatile archive # -for dist in stable +for dist in oldstable stable do echo "retrieve Release(.gpg) $dist-volatile" test -d volatile/${dist}-volatile || mkdir -p volatile/${dist}-volatile -- 2.39.2 From 22aa4548b7518a5bb5245a622bd62a836ccc4d9b Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 21:20:33 +0200 Subject: [PATCH 09/16] syncarchive_installer: Don't skip oldstable, sarge has an installer --- cron.d/100syncarchive_installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron.d/100syncarchive_installer b/cron.d/100syncarchive_installer index 61e6932..396b249 100755 --- a/cron.d/100syncarchive_installer +++ b/cron.d/100syncarchive_installer @@ -13,7 +13,7 @@ then for dist in ${dists} do - if [ $dist = oldstable -o $dist = experimental ]; then + if [ $dist = experimental ]; then continue fi @@ -34,7 +34,7 @@ else for dist in ${dists} do - if [ $dist = oldstable -o $dist = experimental ]; then + if [ $dist = experimental ]; then continue fi -- 2.39.2 From bf6d5b1c3221cdd54d613778ce806804a3faf006 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 02:18:37 +0200 Subject: [PATCH 10/16] Description Search: Move to Xapian Use Xapian as Backend for fulltext search in descriptions. Introduces new do_xapian_search function to be able to switch to the old do_fulltext_search in case of problems. --- bin/parse-packages | 57 +++++++++++++++++++++++++++++++++++----- lib/Packages/DoSearch.pm | 14 +++++++++- lib/Packages/Search.pm | 50 ++++++++++++++++++++++++++++++++++- 3 files changed, 113 insertions(+), 8 deletions(-) diff --git a/bin/parse-packages b/bin/parse-packages index 189ea02..fa81fd4 100755 --- a/bin/parse-packages +++ b/bin/parse-packages @@ -33,6 +33,8 @@ use DB_File; use Storable; use File::Path; use Deb::Versions; +use Lingua::Stem v0.82; +use Search::Xapian; use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES ); &Packages::Config::init( './' ); my %packages_small = (); @@ -52,6 +54,9 @@ my %priorities = (); $/ = ""; -d $DBDIR || mkpath( $DBDIR ); +-d "$DBDIR/xapian.new" && rmtree("$DBDIR/xapian.new"); +-d "$DBDIR/xapian.old" && rmtree("$DBDIR/xapian.old"); +mkpath( "$DBDIR/xapian.new" ); for my $suite (@SUITES) { my %package_names_suite = (); @@ -97,10 +102,14 @@ for my $suite (@SUITES) { my $src_version = ''; if ($data{'source'}) { $src = $data{'source'}; - $src =~ s/\s+.*//; # strip version info + $src =~ s/\s+.*//o; # strip version info } $data{'source'} = $src; - my $descr = $data{'description'}; + # we add some additional data here + my $descr = "$data{'description'}\000$data{'package'}\000" + .($data{'tag'}||''); + my $sdescr = $data{'description'}; + $sdescr =~ s/\n.*//os; my $did = undef; if (exists($descriptions{$descr})) { $did = $descriptions{$descr}; @@ -114,8 +123,6 @@ for my $suite (@SUITES) { $descriptions_packages{$did} .= "$data{'package'} $data{'version'} $data{'architecture'}\000"; - my $sdescr = $descr; - $sdescr =~ s/\n.*//s; my $section = 'main'; my $subsection = $data{section} || '-'; if ($data{section} && ($data{section} =~ m=/=o)) { @@ -178,7 +185,7 @@ while (my ($pkg, $v) = each(%packages_small)) { $res3 .= $v3; } } - + if (exists $virtual_packages{$pkg}) { while (my ($suite, $v2) = each %{$virtual_packages{$pkg}}) { $res1 .= "$suite\01".(join ' ', keys %$v2)."\01"; @@ -223,13 +230,25 @@ while (my ($k, $v) = each(%descriptions_packages)) { } untie %descriptions_packages_db; +my $stemmer = Lingua::Stem->new(); +$stemmer->stem_caching({ -level => 2 }); +my $xapian_db; +eval { + $xapian_db = Search::Xapian::WritableDatabase->new("$DBDIR/xapian.new", + Search::Xapian::DB_CREATE_OR_OPEN) + or die "can't create write-able db object: $!\n"; +}; +die $@ if $@; my %descriptions_db; tie %descriptions_db, "DB_File", "$DBDIR/descriptions.db.new", O_RDWR|O_CREAT, 0666, $DB_BTREE or die "Error creating DB: $!"; open DESCR, ">", "$DBDIR/descriptions.txt" or die "Error creating descriptions textfile"; +print "Index $#descriptions descriptions\n"; for (my $i=1; $i<= $#descriptions; $i++) { my $plain_description = $descriptions[$i]; + # strip away additional data + my ($only_desc) = split /\000/o, $plain_description, 2; # WARNING: This needs to correspond with what happens in # Packages/Search.pm:do_fulltext_search $plain_description =~ tr [A-Z] [a-z]; @@ -238,10 +257,33 @@ for (my $i=1; $i<= $#descriptions; $i++) { $plain_description =~ s/[(),.-]+//og; $plain_description =~ s#[^a-z0-9_/+]+# #og; print DESCR "$plain_description\n"; - $descriptions_db{$i} = $descriptions[$i]; + + #XAPIAN + eval { + my @words = split /\s+/, $plain_description; + my $stem_words = $stemmer->stem( \@words ); + my $doc = Search::Xapian::Document->new() + or die "can't create doc object for $i: $!\n"; + if ($doc->set_data($i)){ + warn "can't set_data in doc object for $i: $!\n"; + } + for my $j (0 .. (@$stem_words-1)) { + next if $stem_words->[$j] =~ /^\s*$/o; + if ($doc->add_posting($stem_words->[$j], $j)) { + warn "can't add word $stem_words->[$j] $j: $!\n"; + } + } + $xapian_db->add_document($doc) + or warn "failed to add document: $i\n"; + }; + die $@ if $@; + + $descriptions_db{$i} = $only_desc; } close DESCR; untie %descriptions_db; +$xapian_db->flush; +undef $xapian_db; # package names stuff: for my $pkg (keys %package_names) { @@ -280,6 +322,9 @@ for my $suite (@SUITES) { rename("$DBDIR/package_names_$suite.txt.new", "$DBDIR/package_names_$suite.txt"); } +rename("$DBDIR/xapian", "$DBDIR/xapian.old"); +rename("$DBDIR/xapian.new","$DBDIR/xapian"); +rmtree("$DBDIR/xapian.old"); rename("$DBDIR/packages_descriptions.db.new", "$DBDIR/packages_descriptions.db"); rename("$DBDIR/descriptions_packages.db.new", diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index 2603ff9..a94dd7b 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -53,10 +53,22 @@ sub do_search { do_names_search( [ @keywords ], \%packages, $p_obj, \&read_entry_all, $opts, \@results, \@non_results ); - do_fulltext_search( [ @keywords ], "$DBDIR/descriptions.txt", +# my $fts0 = new Benchmark; +# do_fulltext_search( [ @keywords ], "$DBDIR/descriptions.txt", +# \%did2pkg, \%packages, +# \&read_entry_all, $opts, +# \@results, \@non_results ); + my $fts1 = new Benchmark; + do_xapian_search( [ @keywords ], "$DBDIR/xapian/", \%did2pkg, \%packages, \&read_entry_all, $opts, \@results, \@non_results ); + my $fts2 = new Benchmark; +# my $fts_grep = timediff($fts1,$fts0); + my $fts_xapian = timediff($fts2,$fts1); +# debug( "Fulltext search took ".timestr($fts_grep)." (grep)" ) if DEBUG; + debug( "Fulltext search took ".timestr($fts_xapian)." (Xapian)" ) + if DEBUG; } } diff --git a/lib/Packages/Search.pm b/lib/Packages/Search.pm index c6a521a..1c36986 100644 --- a/lib/Packages/Search.pm +++ b/lib/Packages/Search.pm @@ -46,6 +46,8 @@ use warnings; use POSIX; use HTML::Entities; use DB_File; +use Lingua::Stem v0.82; +use Search::Xapian qw(:ops); use Deb::Versions; use Packages::CGI; @@ -55,7 +57,7 @@ our @ISA = qw( Exporter ); our @EXPORT_OK = qw( read_entry read_entry_all read_entry_simple read_src_entry read_src_entry_all find_binaries - do_names_search do_fulltext_search + do_names_search do_fulltext_search do_xapian_search ); our %EXPORT_TAGS = ( all => [ @EXPORT_OK ] ); @@ -242,6 +244,52 @@ sub do_fulltext_search { } } +sub do_xapian_search { + my ($keywords, $db, $did2pkg, $packages, $read_entry, $opts, + $results, $non_results) = @_; + +# NOTE: this needs to correspond with parse-packages! + my @tmp; + foreach my $keyword (@$keywords) { + $keyword =~ tr [A-Z] [a-z]; + if ($opts->{exact}) { + $keyword = " $keyword "; + } + $keyword =~ s/[(),.-]+//og; + $keyword =~ s;[^a-z0-9_/+]+; ;og; + push @tmp, $keyword; + } + my $stemmer = Lingua::Stem->new(); + $keywords = $stemmer->stem( @tmp ); + + my $db = Search::Xapian::Database->new( $db ); + my $enq = $db->enquire( OP_AND, @$keywords ); + debug( "Xapian Query was: ".$enq->get_query()->get_description(), 1) if DEBUG; + my @matches = $enq->matches(0, 100); + + my $numres = 0; + my %tmp_results; + foreach my $match ( @matches ) { + my $id = $match->get_docid(); + my $result = $did2pkg->{$id}; + + foreach (split /\000/o, $result) { + my @data = split /\s/, $_, 3; +# debug ("Considering $data[0], arch = $data[2]", 3) if DEBUG; +# next unless $data[2] eq 'all' || $opts->{h_archs}{$data[2]}; +# debug ("Ok", 3) if DEBUG; + $numres++ unless $tmp_results{$data[0]}++; + } + last if $numres > 100; + } + undef $db; + $too_many_hits++ if $numres > 100; + + foreach my $pkg (keys %tmp_results) { + &$read_entry( $packages, $pkg, $results, $non_results, $opts ); + } +} + sub find_binaries { my ($pkg, $archive, $suite, $src2bin) = @_; -- 2.39.2 From febf7ebcdff31595aeb5546be8fc03816fc7a80d Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 02:19:35 +0200 Subject: [PATCH 11/16] mirror.tmpl: Add some more mirrors for volatile Also update the mirror list page to the official one. --- templates/config/mirrors.tmpl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/config/mirrors.tmpl b/templates/config/mirrors.tmpl index d76074b..c9cc50e 100644 --- a/templates/config/mirrors.tmpl +++ b/templates/config/mirrors.tmpl @@ -73,12 +73,24 @@ mirrors = { }, volatile => { - mirror_list => 'http://volatile.debian.net/mirrors.html', + mirror_list => 'http://www.debian.org/devel/debian-volatile/volatile-mirrors', europa => [ "volatile.debian.net/debian-volatile", "ftp2.de.debian.org/debian-volatile", "ftp.sk.debian.org/debian-volatile", ], + north_america => [ + "debian.domainmail.org/debian-volatile", + ], + south_america => [ + "sft.if.usp.br/debian-volatile", + ], + asia => [ + "ftp2.jp.debian.org/debian-volatile", + ], + australia => [ + "ftp.nz.debian.org/debian-volatile", + ], }, backports => { -- 2.39.2 From f3dbe5e16856b44859ace1596b87d45dee3ce6d0 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 02:31:09 +0200 Subject: [PATCH 12/16] Add some .gitignore files Mainly for files generated from *.in by setup-site and for the generated output directories. --- .gitignore | 5 +++++ bin/.gitignore | 1 + conf/.gitignore | 2 ++ static/.gitignore | 1 + 4 files changed, 9 insertions(+) create mode 100644 .gitignore create mode 100644 bin/.gitignore create mode 100644 conf/.gitignore create mode 100644 static/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8808e67 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +www +locale +files +archive +config.sh diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..77934f6 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +mod_perl-startup diff --git a/conf/.gitignore b/conf/.gitignore new file mode 100644 index 0000000..1237df4 --- /dev/null +++ b/conf/.gitignore @@ -0,0 +1,2 @@ +apache.conf +ttreerc diff --git a/static/.gitignore b/static/.gitignore new file mode 100644 index 0000000..9e9436d --- /dev/null +++ b/static/.gitignore @@ -0,0 +1 @@ +packages.css -- 2.39.2 From 46965dfc1ae42443015a3a52758d6fc123eda31c Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 02:54:24 +0200 Subject: [PATCH 13/16] Search.pm: Define fallback suites for oldstable-* We really need to make this regex based (e.g. foo-* always falls back to foo). Anyway, here the short term fix. --- lib/Packages/Search.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Packages/Search.pm b/lib/Packages/Search.pm index 1c36986..fdd3a3a 100644 --- a/lib/Packages/Search.pm +++ b/lib/Packages/Search.pm @@ -102,6 +102,8 @@ sub read_entry { #FIXME: make configurable my %fallback_suites = ( + 'oldstable-backports' => 'oldstable', + 'oldstable-volatile' => 'oldstable', 'stable-backports' => 'stable', 'stable-volatile' => 'stable', experimental => 'unstable' ); -- 2.39.2 From aed456717ac398a96918c7af8770c2733f1942d1 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 12:44:51 +0200 Subject: [PATCH 14/16] Backwards compatibility mode for reportbug Force exact=1 if UserAgent looks like reportbug. Otherwise it would get confused by the new behaviour to show non-exact matches per default, too. The real solution for this is of course to let it use another format instead of HTML. --- cgi-bin/dispatcher.pl | 5 +++++ conf/apache.conf.sed.in | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 1f876de..db9d155 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -83,6 +83,11 @@ debug( "LANGUAGES=@LANGUAGES header=". bindtextdomain ( 'pdo', $LOCALES ); textdomain( 'pdo' ); +if ($ENV{is_reportbug}) { + $input->param('exact', 1); + debug( "reportbug detected, set paramater exact to '1'" ) if DEBUG; +} + my $what_to_do = 'show'; my $source = 0; if (my $path = $input->path_info() || $input->param('PATH_INFO')) { diff --git a/conf/apache.conf.sed.in b/conf/apache.conf.sed.in index 594efd7..48bdde3 100644 --- a/conf/apache.conf.sed.in +++ b/conf/apache.conf.sed.in @@ -100,6 +100,8 @@ allow from all + BrowserMatch reportbug is_reportbug + RewriteEngine on RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 0 -- 2.39.2 From 302567155d3a5f15022fd6d6e3f96433972a920d Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 12:47:04 +0200 Subject: [PATCH 15/16] DoShow.pm: Don't show "special:" debtags packages.d.o is for end users who are probably not interested in the various special: tags that are more useful for debtags maintainance. (This can be moved to the template if ever the need arises to display these tags) --- lib/Packages/DoShow.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 58026e1..cfe7a90 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -126,9 +126,11 @@ sub do_show { # handle tags like devel::{lang:c,lang:c++} if ($tag =~ s/^\{(.+)\}$/$1/) { foreach (split( /,/, $tag )) { + next if $tag =~ /^special:/; push @tags, [ $facet, $_ ]; } } else { + next if $tag =~ /^special:/; push @tags, [ $facet, $tag ]; } } -- 2.39.2 From 3ae801d678a65e67bd393551ba3da9a30fd8155f Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 14 Apr 2007 13:27:40 +0200 Subject: [PATCH 16/16] Add GPL text It was always understood that this code is licensed under the GPL. So it should carry the GPL text with it. --- COPYING | 339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. -- 2.39.2