Diff for /loncom/build/Attic/parse.pl between versions 1.5 and 1.8

version 1.5, 2000/12/09 17:03:57 version 1.8, 2000/12/10 03:06:11
Line 94  if ($mode eq "ALL" || $mode eq "HTML") { Line 94  if ($mode eq "ALL" || $mode eq "HTML") {
     @directories=&determine_directory_structure;      @directories=&determine_directory_structure;
     $a=&make_directory_structure_description_block(\@directories);      $a=&make_directory_structure_description_block(\@directories);
     print $a;      print $a;
       $a=&make_file_type_ownership_and_permissions_description_block;
       print $a;
     $a=&make_directory_and_file_structure_description_block(\@directories);      $a=&make_directory_and_file_structure_description_block(\@directories);
     print $a;      print $a;
     $a=&end_description_page;      $a=&end_description_page;
Line 116  sub begin_description_page { Line 118  sub begin_description_page {
 <LI>About this file  <LI>About this file
 <LI>Software Package Description  <LI>Software Package Description
 <LI>Directory Structure  <LI>Directory Structure
   <LI>File Type Ownership and Permissions
 <LI>File and Directory Structure  <LI>File and Directory Structure
 </UL>  </UL>
 <FONT SIZE=+2>About this file</FONT>  <FONT SIZE=+2>About this file</FONT>
Line 183  sub make_directory_structure_description Line 186  sub make_directory_structure_description
 <TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0>  <TABLE BORDER=1 CELLPADDING=3 CELLSPACING=0>
 END  END
     my $maxcount=0;      my $maxcount=0;
       my @allfiles=keys %{$info{'LOCATION'}{$distribution}};
       my %diraccount; # hash to track which directories are accounted for
       foreach my $file (@allfiles) {
    $file=~/^(.*)\/([^\/]+)$/;
    $diraccount{$1}=1;
       }
     foreach my $d (@$dirs) {      foreach my $d (@$dirs) {
         my (@matches)=($d=~/\//g);          my (@matches)=($d=~/\//g);
  my $count=scalar(@matches);   my $count=scalar(@matches);
  $maxcount=$count if $count>$maxcount;   $maxcount=$count if $count>$maxcount;
    delete $diraccount{$d};
     }      }
     $description.=<<END;      $description.=<<END;
 <TR>  <TR>
Line 195  END Line 205  END
 <TH ALIGN=LEFT BGCOLOR=#FFFFFF><FONT COLOR=#FF0000>Development<BR>Permissions</FONT></TH>  <TH ALIGN=LEFT BGCOLOR=#FFFFFF><FONT COLOR=#FF0000>Development<BR>Permissions</FONT></TH>
 END  END
     $description.="<TH ALIGN=LEFT BGCOLOR=#FFFFFF COLSPAN=".($maxcount+1).">Directory Path</TH>\n";      $description.="<TH ALIGN=LEFT BGCOLOR=#FFFFFF COLSPAN=".($maxcount+1).">Directory Path</TH>\n";
       if (keys %diraccount) {
    $description.= "<TR><TD ALIGN=LEFT BGCOLOR=#FFFFFF COLSPAN=".($maxcount+4)."><I><PRE>Directories that are unaccounted for: \n";
    foreach my $d (keys %diraccount) {
       $description.="$d\n";
    }
    $description.="</PRE></I></TH></TR>\n";
       }
     foreach my $d (@$dirs) {      foreach my $d (@$dirs) {
  my $dtable=$d;   my $dtable=$d;
  $dtable=~s/\//\<\/TD\>\<TD\>/g;   $dtable=~s/\//\<\/TD\>\<TD\>/g;
Line 221  END Line 238  END
     return $description;      return $description;
 }  }
   
   # ------------------- Make file type ownership and permissions description block
   sub make_file_type_ownership_and_permissions_description_block {
       my $description=<<END;
   <FONT SIZE=+2>File Type Ownership and Permissions Descriptions, $date</FONT>
   <P>
   This table shows what permissions and ownership settings correspond
   to each kind of file type.
   </P>
   <P>
   <TABLE BORDER=1 CELLPADDING=5 WIDTH=60%>
   <TR>
   <TH ALIGN=LEFT BGCOLOR=#FFFFFF>Icon</TH>
   <TH ALIGN=LEFT BGCOLOR=#FFFFFF>Type</TH>
   <TH ALIGN=LEFT BGCOLOR=#FFFFFF>Permissions</TH>
   <TH ALIGN=LEFT BGCOLOR=#FFFFFF>Development Permissions</TH>
   </TR>
   END
       foreach my $type (keys %{$info{'OWNERSHIP'}}) {
    if (defined($fcm{$type})) {
       my $chmod=$info{'OWNERSHIP'}{$type}{'CHMOD'};
       my $chown=$info{'OWNERSHIP'}{$type}{'CHOWN'};
       my $devchmod=$info{'DEVOWNERSHIP'}{$type}{'CHMOD'};
       my $devchown=$info{'DEVOWNERSHIP'}{$type}{'CHOWN'};
       $description.=<<END;
   <TR>
   <TD><IMG SRC="$fcm{$type}.gif" ALT="$type"></TD>
   <TD>$type</TD>
   <TD><TT>$chmod $chown</TT></TD>
   <TD><TT>$devchmod $devchown</TT></TD>
   </TR>
   END
           }
       }
       $description.=<<END;
   </TABLE>
   </P>
   END
   }
   
 # ------------------------- Make directory and file structure description block  # ------------------------- Make directory and file structure description block
 sub make_directory_and_file_structure_description_block {  sub make_directory_and_file_structure_description_block {
     my ($dirs)=@_;      my ($dirs)=@_;
     my $description=<<END;      my $description=<<END;
 <FONT SIZE=+2>Directory and File Structure Description, $date</FONT>  <FONT SIZE=+2>Directory and File Structure Description, $date</FONT>
 <P>  <P>
   The icons on the left column correspond to the file type
   specified in the second column.  The last column "Notes" shows compilation,
   dependency, and configuration information.  The CVS location
   shows the location of the binary source file (if applicable) needed to
   be copied to the target.  If the binary source file is not at
   the specified location, then the text is shown in 
   <FONT COLOR=#FF0000>red</FONT>.
   </P>
   <P>
 <TABLE BORDER=1 CELLPADDING=5 WIDTH=60%>  <TABLE BORDER=1 CELLPADDING=5 WIDTH=60%>
 END  END
     my $counter=0;      my $counter=0;
Line 281  END Line 346  END
  my $category=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'CATEGORY'};   my $category=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'CATEGORY'};
  my $fdescription=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'DESCRIPTION'};   my $fdescription=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'DESCRIPTION'};
  my $source=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'SOURCE'};   my $source=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'SOURCE'};
    unless (-e "../../$source") {
       $source=~/([^\/]+)$/;
       my $s=$1;
       $source="<FONT COLOR=#FF0000>$source</FONT>";
   #    my $fr=`cd ../../; find . -name $s`;
   #    $source.="<BR>$fr\n";
    }
  my $notes=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'NOTES'};   my $notes=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'NOTES'};
  $description.=<<END;   $description.=<<END;
 <TR>  <TR>

Removed from v.1.5  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>