--- loncom/build/Attic/parse.pl 2000/12/08 20:28:57 1.4 +++ loncom/build/Attic/parse.pl 2000/12/09 17:03:57 1.5 @@ -12,17 +12,30 @@ my ($file,$mode)=@ARGV; open IN,"<$file"; my @lines=; close IN; -my $info=join('',@lines); -my $info2=$info; # value to allow for meta data group retrieval +my $info1=join('',@lines); +my $info2=$info1; # value to allow for meta data group retrieval # ------------------------------------------------------- Make default settings my $distribution="redhat6.2"; my $date=`date +'%B %e, %Y'`; chop $date; my $buildhost=`hostname`; chop $buildhost; +# file category mappings +my %fcm=( + 'conf' => 'configurable', + 'graphic file' => 'graphicfile', + 'handler' => 'handler', + 'interface file' => 'interfacefile', + 'symbolic link' => 'link', + 'root script' => 'rootscript', + 'script' => 'script', + 'setuid script' => 'setuid', + 'static conf' => 'static', + 'system file' => 'systemfile', + ); # ---------------------------------------------------- Parse the marked up data my %info; # big data storage object -while ($info=~/\/isg) { +while ($info1=~/\/isg) { my $keystring=$1; # In the parsing of LON-CAPA tags, remove boundary white-space, # and handle quotation commands. @@ -31,7 +44,6 @@ while ($info=~/\/isg) $value=~s/"$//; (uc($key),$value);} split(/\s+(?=\w+\s*\=)/,$keystring); - # Handle the different types of commands if (uc($hash{'TYPE'}) eq "OWNERSHIP") { $info{$hash{'TYPE'}}{$hash{'CATEGORY'}}{'CHMOD'}=$hash{'CHMOD'}; @@ -52,12 +64,11 @@ while ($info=~/\/isg) $hash{'DESCRIPTION'} if $hash{'DESCRIPTION'}; } elsif (uc($hash{'TYPE'}) eq "LOCATION") { - $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{'CATEGORY'}= - $hash{'CATEGORY'}; - $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{'SOURCE'}= - $hash{'SOURCE'}; + $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{'CATEGORY'}= $hash{'CATEGORY'}; + $info{$hash{'TYPE'}}{$hash{'DIST'}}{$hash{'TARGET'}}{'SOURCE'}= $hash{'SOURCE'}; # get surrounding metagroup information my $ckeystring=$keystring; $ckeystring=~s/(SOURCE\=\"[^"]*)\*/$1\\\*/g; + $ckeystring=~s/(TARGET\=\"[^"]*)\*/$1\\\*/g; $info2=~/.*\<(?:metagroup|metasupergroup)\>(.*?)\(.*?)\<\/(?:metagroup|metasupergroup)\>/is; my $data=$1.$2; my @meta=('description','build','dependencies','files','note'); @@ -122,7 +133,7 @@ END sub end_description_page { my $description=< -LON-CAPA Software Development Team +LON-CAPA Software Development Team END @@ -216,11 +227,11 @@ sub make_directory_and_file_structure_de my $description=<Directory and File Structure Description, $date

- +
END my $counter=0; my @colorindex=("#80FF80","#80FFFF","#FFFF80"); - my @allfiles=keys %{$info{'LOCATION'}{$distribution}{'TARGET'}}; + my @allfiles=keys %{$info{'LOCATION'}{$distribution}}; foreach my $d (@$dirs) { # set color my $color=$colorindex[$counter%3]; @@ -230,43 +241,59 @@ END # find subdirectories that are contained in this directory my @subdirs; foreach my $d2 (@$dirs) { - if ($d2=~/$d\/([^\/]+)/) { + if ($d2=~/^$d\/([^\/]+)$/) { push @subdirs,$1; } } # find files that are contained in this directory my @files; + my @filesfull; foreach my $f (@allfiles) { - if ($file=~/$d\/(.+)/) { + if ($f=~/^$d\/([^\/]+)$/) { push @files,$1; + push @filesfull,$f; } } # render starting HTML formatting elements if (@subdirs || @files) { my $subdirstring="
* Relevant subdirectories: " . join(", ",@subdirs) if @subdirs; $description.=< END } else { $description.=< + END } if (@files) { $description.=< - - - - + + + + + END - } - $description.=< + + + + + + END + } + } $counter++; } $description.=<
directoryDIRECTORY -- $d $dirdescription -$subdirstring +
directoryDIRECTORY -- $d $dirdescription +$subdirstring
empty directoryEMPTY DIRECTORY - $d $dirdescription
empty directoryEMPTY DIRECTORY - $d $dirdescription
TypeFile NameFunctionNotesTypeFile NameFunctionCVS LocationNotes
$category$category$files[$i]$fdescription $source$notes