+Amiga etc.
[MyWeb.git] / Project.pm
index 6be4127..3599cac 100644 (file)
@@ -38,54 +38,7 @@ my($class,$ListItem)=@_;
        print $ListItem->{"description"};
        print "<hr />\n";
        my @table=(
-               {"key"=>qr(^download\b),"text"=>sub ($) {
-                                               $_[0]=~s/^download//;
-                                               $_[0]=~s/^-/ /;
-                                               return "Download".$_[0];
-                                               },
-                               "format"=>sub ($) {
-                                               my $r;
-                                               if ($_[0]=~m#^[a-z]+://#) {
-                                                       $r=a_href($_[0],CGI::escapeHTML($_[0]));
-                                                       }
-                                               else {
-                                                       $r=a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0])));
-                                                       my $size=(stat $_[0])[7];
-                                                       die "Cannot stat \"".$_[0]."\": $!" if !defined $size;
-                                                                if ($size>=1024*1024) { $size=int($size/(1024*1024))." MB"; }
-                                                       elsif ($size>=1024     ) { $size=int($size/(1024     ))." KB"; }
-                                                       else                     { $size=int($size            )." B"; }
-                                                       $r.=" ($size)";
-                                                       }
-                                               return $r;
-                                               }},
-               {"key"=>qr(^link\b),"text"=>sub ($) {
-                                               $_[0]=~s/^link-//;
-                                               return $_[0];
-                                               },
-                               "format"=>sub ($) {
-                                               return a_href($_[0],CGI::escapeHTML($_[0]));
-                                               }},
-               {"key"=>qr(^cvs\b),"text"=>sub ($) {
-                                               $_[0]=~s/^cvs//;
-                                               $_[0]=~s/^-/ /;
-                                               return "CVS".$_[0];
-                                               },
-                               "format"=>sub ($$) {
-                                               my($val,$key)=@_;
-                                               $key=~s/^cvs//;
-                                               $key=~s/^-/ /;
-                                               my $branch="";
-                                               $branch="only_with_tag=$1" if $val=~s/:(.*)//;
-                                               return join("<br />\n\t\t",map({ a_href($_->[1],$_->[0]); }
-                                                               ["ViewCVS CVS repository",$W->{"project_viewcvs"}.$val."/".(!$branch ? '' : '?'.$branch)],
-                                                               ["Download CVS snapshot" ,
-                                                                               $W->{"project_viewcvs"}.$val."/".File::Basename::basename($val).".tar.gz?tarball=1"
-                                                                                               .(!$branch ? '' : '&'.$branch)],
-                                                               ["CVS ChangeLog"         ,$W->{"top_dir"}."/project/ChangeLog.txt.pl?cvs=$val"]));
-                                               }},
                {"key"=>"summary","text"=>"Summary"},
-               {"key"=>"ownership","text"=>"Ownership"},
                {"key"=>"license","text"=>"License","format"=>sub ($) {
                                my %known=(
                                                "PD"=>"Public Domain",
@@ -97,7 +50,7 @@ my($class,$ListItem)=@_;
                                }},
                {"key"=>"maintenance","text"=>"State","format"=>sub ($) {
                                my %known=(
-                                               "active"=>"Ready to use and the package is being actively developed.",
+                                               "active"=>"Ready to use. Project is now actively developed.",
                                                "ready"=>"Ready to use although no longer being actively developed.",
                                                "dead"=>"Dead code, no longer supported.",
                                                "merge"=>"Functions belong to existing other project.",
@@ -113,6 +66,51 @@ my($class,$ListItem)=@_;
                                        }
                                return join(" ",@r);
                                }},
+               {"key"=>"aminet","text"=>a_href('http://www.aminet.net/','Aminet'),"format"=>sub ($) {
+                               return join(" ",
+                                               a_href('http://www.aminet.net/'.$_[0].".lha",$_[0].".lha"),
+                                               "(".a_href('http://www.aminet.net/'.$_[0].".readme","readme").")");
+                               }},
+               {"key"=>qr(^download\b),"text"=>sub ($) {
+                                               $_[0]=~s/^download//;
+                                               $_[0]=~s/^-/ /;
+                                               return "Download".$_[0];
+                                               },
+                               "format"=>sub ($) {
+                                               return a_href($_[0],CGI::escapeHTML($_[0]));
+                                               }},
+               {"key"=>qr(^link\b),"text"=>sub ($) {
+                                               $_[0]=~s/^link-//;
+                                               return $_[0];
+                                               },
+                               "format"=>sub ($) {
+                                               return a_href($_[0],CGI::escapeHTML($_[0]));
+                                               }},
+               {"key"=>qr(^cvs\b),"text"=>sub ($) {
+                                               $_[0]=~s/^cvs//;
+                                               $_[0]=~s/^-/ /;
+                                               return "CVS".$_[0];
+                                               },
+                               "format"=>sub ($$) {
+                                               my($val,$key)=@_;
+                                               $key=~s/^cvs//;
+                                               $key=~s/^-/ /;
+                                               my $branch="";
+                                               $branch=$1 if $val=~s/:(.*)//;
+                                               return join("<br />\n\t\t",
+                                                               CGI::escapeHTML("cvs -d ".$W->{"pserver"}.":".$W->{"pserver_path"}." -z3"
+                                                                               ." checkout".(!$branch ? "" : " -r $branch -kk")
+                                                                               .($val!~m#/# ? "" : " -d ".File::Basename::basename($val))
+                                                                               ." $val"),
+                                                               join(" | \n\t\t",
+                                                                               map({ a_href($_->[1],$_->[0]); }
+                                                                                               ["ViewCVS CVS repository",$W->{"project_viewcvs"}.$val."/".(!$branch ? "" : '?only_with_tag='.$branch)],
+                                                                                               ["Download CVS snapshot" ,
+                                                                                                               $W->{"project_viewcvs"}.$val."/".File::Basename::basename($val).".tar.gz?tarball=1"
+                                                                                                                               .(!$branch ? "" : '&only_with_tag='.$branch)],
+                                                                                               ["CVS ChangeLog"         ,$W->{"top_dir"}."/project/ChangeLog.txt.pl?cvs=$val"])));
+                                               }},
+               {"key"=>"ownership","text"=>"Ownership"},
                {"key"=>"sponsorship","text"=>"Sponsoring Company"},
                {"key"=>"language","text"=>"Programming language","format"=>sub ($) {
                                return a_href("http://java.sun.com/",CGI::escapeHTML($_[0]))