diff --git a/ja/ports/portindex b/ja/ports/portindex index 2ba78e6d7c..8b2a3d38de 100755 --- a/ja/ports/portindex +++ b/ja/ports/portindex @@ -1,296 +1,296 @@ #!/usr/bin/perl # convert a ports INDEX file to HTML # # by John Fieber # Mon May 13 10:31:58 EST 1996 -# $FreeBSD: www/ja/ports/portindex,v 1.23 2001/01/02 02:22:50 kuriyama Exp $ +# $FreeBSD: www/ja/ports/portindex,v 1.24 2001/05/21 14:47:09 kuriyama Exp $ # The FreeBSD Japanese Documentation Project -# Original revision: 1.40 +# Original revision: 1.41 ############################################################ # Load local config file. You can override in portindex.conf # the variables for the default web and the ftp server. This # make it easy to maintain a local web mirror and let the # URL point to yourself and not to the standard FreeBSD FTP server. $config = $0 . '.' . 'conf'; do $config if -f $config; # This is the base of where we ftp stuff from if ($ENV{'MASTER_FTP_SERVER'}) { $ftpserver = $ENV{'MASTER_FTP_SERVER'}; } else { - $ftpserver = 'ftp://ftp5.freebsd.org' if !$ftpserver; + $ftpserver = 'ftp://ftp.freebsd.org' if !$ftpserver; } $base = "" if !$base; $baseHTTP = $base if !$baseHTTP; $baseFTP = "$ftpserver/pub/FreeBSD/branches/-current/"; $urlcgi = 'http://www.freebsd.org/cgi/url.cgi' if !$urlcgi; $packagesURL = "$ftpserver/pub/FreeBSD/ports/i386/packages-stable/All/" if !$packagesURL; # support tar on the fly or gzip'ed tar on the fly $ftparchive = ''; -$ftparchive = 'tar' if !defined $ftparchive; +$ftparchive = '.tar' if !defined $ftparchive; # ports download sources script $pds = 'http://www.freebsd.org/cgi/pds.cgi'; # better layout and link to the sources if ($urlcgi) { $baseHTTP = $urlcgi . '?' . $baseHTTP; } $today = &getdate; &packages_exist('packages.exists', *packages); &category_description(($ARGV[1] || '.') . '/categories', *category_description); &main; sub getdate { # @months = ("January", "February", "March", "April", "May","June", # "July", "August", "September", "October", "November", "December"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; # return "Last modified: $mday-$months[$mon]-$year"; $mon++; return "最終更新日: $year 年 $mon 月 $mday 日"; } sub header { local ($fh, $htext) = @_; print $fh ""; print $fh ""; print $fh "$today\">\n"; print $fh ""; print $fh "\n"; print $fh "\n"; print $fh ""; print $fh "%includes;\n"; print $fh "]>\n"; print $fh "&header;\n"; } sub footer { local ($fh, $ftext) = @_; print $fh "\n$ftext\n"; print $fh "&footer;\n"; print $fh "\n\n"; } sub packages_exist { local($file, *p) = @_; open(P, $file) || do { warn "open $file: $!\n"; warn "Cannot create packages links\n"; return 1; }; while(

) { chop; $p{$_} = 1; } close P; return 0; } sub category_description { local($file, *p) = @_; open(P, $file) || do { warn "open $file: $!\n"; warn "Cannot find category description\n"; return 1; }; local($category, $description); while(

) { # ignore comments next if /^\s*#/; ($category, $description) = /^\s*"([^"]+)",\s*"([^"]+)/; $p{$category} = $description; } close P; return 0; } sub main { $sep = ":"; # 'COMMENT' translation database if (open(COMF, "comments.ja")) { while () { ($a, $b) = split('\|'); next if !defined($b); chop($b); $b =~ s/&/&/g; $b =~ s//>/g; $descLANG{$a} = $b; } } open(INDEX, $ARGV[0]); while () { chop; s/&/&/g; s//>/g; # Read a record ($name, $loc, $prefix, $desc, $ldesc, $owner, $cats, $bdep, $rdep, $www) = split('\|'); # Check for double hyphens in the name (--). $name =~ s/--/-/g; # Split the categories into an array @cat = split("[ \t]+", $cats); $catkey{$name} = $cat[0]; local($sourcepath) = $loc; $sourcepath =~ s%/usr/%%; # desc translation ($lloc = $loc) =~ s@^/usr/ports/@@; $desc = $descLANG{$lloc} if ($descLANG{$lloc} ne ''); foreach $i (@cat) { $stats{$i}++; # figure out the FTP url $loc =~ s/\/usr\//$baseFTP/; $ldesc =~ s/\/usr\//$baseHTTP/; # The name description and maintainer - $data{$i} .= "

$name "; + $data{$i} .= "
$name "; $data{$i} .= "
$desc
詳しい説明"; if ($packages{"$name.tgz"}) { $data{$i} .= qq{ | パッケージ}; } $data{$i} .= qq{ | ソース}; if ($www ne "") { $data{$i} .= qq{ | Main Web Site}; } $ownerurl = $owner; $ownerurl =~ s/<//g; $data{$i} .= "
保守担当者: $owner"; # If there are any dependencies, list them if ($bdep ne "" || $rdep ne "") { $data{$i} .= "
必要なもの: "; @dep = split(/ /, "$bdep $rdep"); local($last) = ''; foreach $j (sort @dep) { next if $j eq $last; $last = $j; $data{$i} .= " $j,"; } # remove the trailing comma chop $data{$i}; } # If the port is listed in more than one category, throw # in some cross references if ($#cat > 0) { $data{$i} .= "
ここにも含まれています: "; foreach $j (@cat) { if ($j ne $i) { if ($j eq $cat[0]) { $data{$i} .= " \u$j,"; } else { $data{$i} .= " \u$j,"; } } } # remove the trailing comma chop($data{$i}); } $data{$i} .= "

\n" } # Add an entry to the master index # workaround for SGML bug, `--' is not allowed in comments local($sname) = $name; $sname =~ s/--/-=/g; $master[$portnumber] = "$name " . " -- $desc
\n"; $portnumber++; } open(MOUTF, ">index.sgml"); &header(MOUTF, "FreeBSD Ports"); # print MOUTF "\n"; print MOUTF "&blurb;"; print MOUTF "

FreeBSD Ports Collection には, 現時点で $portnumber 個の ports が提供されています.
全ての $portnumber 個の ports を tar でまとめて gzip したもの (およそ 10 メガバイト) をダウンロードするか, 以下の分類からたどってください:\n"; print MOUTF "

\n"; print MOUTF "\n"; &footer(MOUTF, ""); close(MOUTF); # Create the master index file open(MINDEX, ">master-index.sgml"); &header(MINDEX, "FreeBSD Ports Collection 一覧"); print MINDEX "

\n"; print MINDEX sort @master; print MINDEX "

"; &footer(MINDEX, "Port の分類"); close(MINDEX); close(INDEX); }