warn on projects with unregistered/unknown "platform" field.
authorshort <>
Tue, 13 Dec 2005 05:17:50 +0000 (05:17 +0000)
committershort <>
Tue, 13 Dec 2005 05:17:50 +0000 (05:17 +0000)
project/Index.pm
project/List.pm

index c0ba713..07475ff 100755 (executable)
@@ -43,6 +43,7 @@ print(project::Lib->views("Detailed"));
 print(project::Lib->platforms(undef(),"novskip"=>1));
 
 my %item=project::Lib->name_to_hashref();
+my %item_unused=%item;
 
 my @platforms=@project::Lib::platforms;
 while (@platforms) {
@@ -55,6 +56,7 @@ while (@platforms) {
                        (lc($item{$a}{"name"}) cmp lc($item{$b}{"name"}));
                        } map({ $item{$_}{"platform"} ne $platform_sym ? () : ($_); } keys(%item));
        for my $project (@projects) {
+               delete $item_unused{$project};
                my $t="";
 
                $t.="<h3>".a_href("/project/$project/",$item{$project}{"name"}.": ".$item{$project}{"summary"})."</h3>\n";
@@ -71,6 +73,7 @@ while (@platforms) {
                        }
                }
        }
+cluck "INVALID 'platform': $_" for keys(%item_unused);
 
 
 exit;
index e8e913d..b7e3b74 100755 (executable)
@@ -25,6 +25,7 @@ use warnings;
 
 use My::Web;
 Wrequire 'project::Lib';
+use Carp qw(confess cluck);
 
 
 sub handler
@@ -45,6 +46,7 @@ print(project::Lib->views(($W->{"args"}{"platform"} ? "BriefPlatform" : "BriefUn
 print(project::Lib->platforms(undef(),"novskip"=>1)) if $W->{"args"}{"platform"};
 
 my %item=project::Lib->name_to_hashref();
+my %item_unused=%item;
 
 # $col{"name"}{"show"}=1
 # $col{"name"}{"format"}=sub { "<".$_[0].">"; }
@@ -120,6 +122,7 @@ my($platform)=@_;
                        print '<tr>';
                        for my $col (@col_order) {
                                next if defined $col{$col}{"show"} && !$col{$col}{"show"};
+                               delete $item_unused{$row};
                                print '<td>';
                                if (!$col{$col}{"format"}) {
                                        print(($item{$row}{$col} || ""));
@@ -153,6 +156,7 @@ else {
                &{$print_one_platform}($platform_sym);
                }
        }
+cluck "INVALID 'platform': $_" for keys(%item_unused);
 
 
 exit;