[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: packages.debian.org does not honor pools



On Sun, Jan 14, 2001 at 11:00:38PM +0100, Martin Schulze wrote:
> Jason Gunthorpe wrote:
> > 
> > On Sun, 14 Jan 2001, Josip Rodin wrote:
> > 
> > > Er, what? If the links are wrong, it's most probably due to the fact mirror
> > > on the machine (master) is outdated.
> > 
> > That mirror is no longer running, and cannot be made to run. You will have
> > to make the web pages not rely on a local mirror.
> 
> I guess that Packages.gz and Sources.gz files would be enough
> to get the pages display proper links, somebody needs to
> rewrite the scripts, no?

Here is a patch to get the Packages and Sources files from
ftp.debian.org, rather than the local mirror, when generating the
packages.debian.org pages.  Only one function appeared to rely on
the local mirror being available when generating the pages, and it
didn't seem to be called.

Matt

P.S. This isn't tested.
--- create_package_pages.pl.orig	Sun Jan 14 15:26:00 2001
+++ create_package_pages.pl	Sun Jan 14 15:33:25 2001
@@ -13,7 +13,6 @@
 	"site|s=s" => \$site,
 	"nonus_site|n=s" => \$nonus_site,
 	"html_root|h=s" => \$html_root,
-	"local_archive_base|l=s" => \$local_archive_base,
 	"md5file|m=s" => \$md5file
             );
 
@@ -34,10 +33,6 @@
 }
 if (! defined $html_root) {
 	print "Error: No --html_root option given\n";
-	exit;
-}
-if (! defined $local_archive_base) {
-	print "Error: No --local_archive_base option given\n";
 	exit;
 }
 if ($#ARGV >= 0) {
--- crontab.orig	Sun Jan 14 15:24:41 2001
+++ crontab	Sun Jan 14 15:37:24 2001
@@ -8,7 +8,6 @@
 swishdir=$topdir/swish++
 htmldir=$topdir/www
 ftpsite=http://ftp.debian.org/debian
-ftpdir=/org/ftp.debian.org/ftp
 nonus_ftpsite=http://non-us.debian.org/debian-non-US
 # set the below variable to frozen when we are in a freeze
 frozen=""
@@ -28,7 +27,10 @@
   test -d ${dist} || mkdir -p ${dist}
   echo "getting Packages/Sources from ${dist}" >> $topdir/logfile
   for sect in main contrib non-free; do
-    zcat $ftpdir/dists/${dist}/${sect}/source/Sources.gz > ${dist}/${sect}.Sources
+    { wget -q $ftpsite/dists/${dist}/${sect}/binary-i386/Packages && \
+    	mv Packages ${dist}/${sect}.Packages; } || true
+    { wget -q $ftpsite/dists/${dist}/${sect}/source/Sources.gz && \
+    	gunzip Sources.gz && mv Sources ${dist}/${sect}.Sources; } || true
     { wget -q $nonus_ftpsite/dists/${dist}/non-US/${sect}/binary-i386/Packages && \
   	mv Packages ${dist}/${sect}.Packages.non-US; } || true
     { wget -q $nonus_ftpsite/dists/${dist}/non-US/${sect}/source/Sources.gz && \
@@ -41,9 +43,8 @@
   	-s $ftpsite \
   	-n $nonus_ftpsite \
   	-h $htmldir/${dist} \
-  	-l $ftpdir \
   	-m $script_base/md5sum.${dist} \
-  	$ftpdir/dists/${dist}/{main,contrib,non-free}/binary-i386/Packages \
+  	$script_base/${dist}/{main,contrib,non-free}.Packages \
   	$script_base/${dist}/{main,contrib,non-free}.Packages.non-US \
   	$script_base/${dist}/{main,contrib,non-free}.Sources \
   	$script_base/${dist}/{main,contrib,non-free}.Sources.non-US
--- pages.pl.orig	Sun Jan 14 15:28:17 2001
+++ pages.pl	Sun Jan 14 15:33:49 2001
@@ -368,36 +368,3 @@
 	}
 	close MD5H;
 }
-
-
-sub print_dsc_files() {
-	my ($path, $dsc_file, $source_name) = @_;
-	if ($dsc_file eq '') {
-		$package_page .= "<i>Couldn't find the .dsc file for the package</i>\n";
-		print "Couldn't find the dsc file for $source_name\n";
-	}
-	else {
-		$package_page .= "<a href=\"$site/$path/$dsc_file\">[dsc]</a>\n";
-		open(FILEH, "<$local_archive_base/$path/$dsc_file") or
-			print "Couldn't open $local_archive_base/$path/$dsc_file\n";
-		while (<FILEH>) {
-			if ($_ =~ /^Files:/io) {
-				while (<FILEH>) {
-					if ($_ =~ /^ (\w+) (\d+) (.+)$/) {
-						$md5 = $1;
-						$size = $2;
-						$name = $3;
-						$package_page .= "<a href=\"$site/$path/$name\">[$name]</a>\n";
-					}
-					else {
-						last;
-					}
-				}
-			}
-		}
-		close FILEH;
-	}
-}
-
-
-

Attachment: pgptjPObCOb1h.pgp
Description: PGP signature


Reply to: