From: Jeroen van Wolffelaar Date: Thu, 2 Feb 2006 15:52:46 +0000 (+0000) Subject: Do some work to get show_package.pl to work -- not completed yet X-Git-Tag: switch-to-templates~181 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=68f4ac9132dd489ef93927f1453122be66ea75d5;p=deb%2Fpackages.git Do some work to get show_package.pl to work -- not completed yet --- diff --git a/cgi-bin/index.php b/cgi-bin/index.php index 5e9809d..006db80 100644 --- a/cgi-bin/index.php +++ b/cgi-bin/index.php @@ -25,7 +25,7 @@ function go($script) $SUITES = array('oldstable', 'stable', 'testing', 'unstable', 'experimental'); $pi = substr($_SERVER["PATH_INFO"], 1); $elems = explode('/', $pi); -if (!$elems) { +if ($pi == "") { readfile("index.html"); exit; } elseif ($pi == 'search') { diff --git a/cgi-bin/show_package.pl b/cgi-bin/show_package.pl index 260d5ce..bfcb905 100755 --- a/cgi-bin/show_package.pl +++ b/cgi-bin/show_package.pl @@ -26,6 +26,7 @@ use lib "../lib"; use Deb::Versions; use Packages::Search qw( :all ); use Packages::HTML (); +use Packages::Page (); my $HOME = "http://www.debian.org"; my $ROOT = ""; @@ -42,7 +43,6 @@ my %ARCHIVES = map { $_ => 1 } @ARCHIVES; my %ARCHITECTURES = map { $_ => 1 } @ARCHITECTURES; - $ENV{PATH} = "/bin:/usr/bin"; # Read in all the variables set by the form @@ -111,10 +111,15 @@ if $format eq 'html'; } while () { $topdir = $1 if (/^\s*topdir="?(.*)"?\s*$/); + $ROOT = $1 if /^\s*root="?(.*)"?\s*$/; } close (C); my $DBDIR = $topdir . "/files/db"; +my $DL_URL = "$package/download"; +my $FILELIST_URL = "$package/files"; +my $DDPO_URL = "http://qa.debian.org/developer.php?email="; + my $obj1 = tie my %packages, 'DB_File', "$DBDIR/packages_small.db", O_RDONLY, 0666, $DB_BTREE or die "couldn't tie DB $DBDIR/packages_small.db: $!"; @@ -158,6 +163,8 @@ for my $entry (@results) { sub showpackage { my ( $pkg ) = @_; + + my $env; my $name = $pkg->get_name; @@ -194,8 +201,6 @@ sub showpackage { || $env->{db}->is_translated( $name, $d->{version}, ${$versions{v2a}{$d->{version}}}[0], $lang )) { - $files->delete_file( $filename ) - if $files->file_exists( $filename ); next; } progress() if $env->{opts}{progress}; @@ -350,11 +355,6 @@ sub showpackage { } $package_page .= trailer( '../..', $name, $lang, @tr_langs ); - # - # write file - # - $files->update_file( $filename, $package_page ); - # # create data sheet #