X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=Project.pm;h=6fed1112948998781bbd061221cfa075ab99bb71;hb=55557c1dfc60f6f77c1ace1d0dce5d5009800fc3;hp=3599cac239e869186c9ad32152173fdca6073f9c;hpb=afce39eaa94318a00cd15ae615170c892e886dda;p=MyWeb.git diff --git a/Project.pm b/Project.pm index 3599cac..6fed111 100644 --- a/Project.pm +++ b/Project.pm @@ -30,11 +30,15 @@ our @EXPORT=qw(); our @ISA=qw(My::Web Exporter); +sub ENTRIES { return top_dir()."/project/CVS/Entries"; } +sub ENTRIES_LOG { return top_dir()."/project/CVS/Entries.Log"; } + + sub print_project ($) { my($class,$ListItem)=@_; - print "

".$ListItem->{"name"}."

\n"; + print "

".$W->{"title"}."

\n"; print $ListItem->{"description"}; print "
\n"; my @table=( @@ -51,7 +55,8 @@ my($class,$ListItem)=@_; {"key"=>"maintenance","text"=>"State","format"=>sub ($) { my %known=( "active"=>"Ready to use. Project is now actively developed.", - "ready"=>"Ready to use although no longer being actively developed.", + "ready"=>"Ready to use. Maintained.", + "pending"=>"Patch is ready to be applied to the mainstream.", "dead"=>"Dead code, no longer supported.", "merge"=>"Functions belong to existing other project.", "obsolete"=>"Obsoleted.", @@ -77,14 +82,14 @@ my($class,$ListItem)=@_; return "Download".$_[0]; }, "format"=>sub ($) { - return a_href($_[0],CGI::escapeHTML($_[0])); + return a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0]))); }}, {"key"=>qr(^link\b),"text"=>sub ($) { $_[0]=~s/^link-//; return $_[0]; }, "format"=>sub ($) { - return a_href($_[0],CGI::escapeHTML($_[0])); + return($_[0]=~/^qr(^cvs\b),"text"=>sub ($) { $_[0]=~s/^cvs//; @@ -108,10 +113,10 @@ my($class,$ListItem)=@_; ["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"]))); + ["CVS ChangeLog" ,top_dir()."/project/ChangeLog.txt.pl?cvs=$val"]))); }}, {"key"=>"ownership","text"=>"Ownership"}, - {"key"=>"sponsorship","text"=>"Sponsoring Company"}, + {"key"=>"sponsorship","text"=>"Sponsorship"}, {"key"=>"language","text"=>"Programming language","format"=>sub ($) { return a_href("http://java.sun.com/",CGI::escapeHTML($_[0])) if $_[0]=~/^Java\b/; @@ -176,10 +181,8 @@ sub init_project ($%) my($class,%args)=@_; my $ListItem={ project_arr_to_hash(@{$args{"ListItem"}}) }; - my $name=$ListItem->{"name"}; - $name=~s#]*>([^<]*)#$1#g; my $W=$class->init( - "title"=>$name, + "title"=>$ListItem->{"name"}.": ".$ListItem->{"summary"}, %args, "head_css"=>($args{"head_css"} || "")." table.print_project td { vertical-align: top; } @@ -190,4 +193,30 @@ table.print_project td { vertical-align: top; } return $W; } +sub item_hash_read () +{ + my %dirs; + for my $ENTRIES (ENTRIES(),ENTRIES_LOG()) { + local *E; + next if !open E,$ENTRIES; + while () { + chomp; + do { $dirs{$1}=1; next; } if m#^(?:A )?D/([^/]*)/#; + next if m#^/([^/]*)/# ; + next if /^D$/; + warn "File $ENTRIES contains invalid line \"$_\": $!"; + } + close E; + } + + my %item; + for my $dir (keys(%dirs)) { + Wrequire "project::${dir}::ListItem"; + my $item=eval('\@project::'.$dir.'::ListItem::ListItem'); + do { warn "Broken project/$dir/ListItem.pm"; next; } if !defined $item; + $item{$dir}={ My::Project::project_arr_to_hash(@$item) }; + } + return %item; +} + 1;