#!/usr/bin/perl #$SVNURL="https://svn.so-much-stuff.com/svn/trunk/Eagle/projects"; $SVNURL="/pdp8/trunk/Eagle/projects"; $head = <<'EOM'; EOM print $head; # # Return a suitable link to the current object. As a side effect, # create a dependency list for the object if it needs a .zip file. $files = $dirs = 0; sub link { # $d is the directory. $files++; return "$SVNURL/$d"; } # # Read a DESCRIPTION file, and extract the documentation from it. sub description { $dirs++; open(INPUT, 'DESCRIPTION') || return; $lineone = ''; $lineone = ; if ($f) { $tag = $d; # Convert $tag into a link $link = &link(); print "
\n"; print " $d: $lineone\n"; print ""; } @work = (); while () { if (s/([^<]*)<\/b> *//i) { $tag = $1; $desc = $_; while ($desc !~ /<\/LI>/) { $desc .= || die "$d:$tag: Missing in DESCRIPTION"; } push(@work, $tag); # Remove old HTML that might make a mess later. $desc =~ s/<[^>]*>//g; $work{$tag} = $desc; } } close(INPUT); if (@work) { # Emit HTML.
print "
\n"; foreach $tag (@work) { print "
$tag\n"; print "
$work{$tag}"; } print "
\n"; } } # # Process a directory. sub process { local($d) = @_; local(@sub); chdir($root) || die "$root: $!"; chdir($d) || die "$d: $!"; # Skip directories without documentation. if (-f 'DESCRIPTION') { &description(); # Get a list of the subdirectories. @sub = (); opendir(DIR, '.') || die "$d: $!"; sub byname { $a cmp $b } foreach (sort byname readdir(DIR)) { $f = $_; if (-d $f) { next if $f eq '.'; next if $f eq '..'; next if $f eq '.svn'; # Mark directories to skip by imbedding a blank in the name. next if $f =~ / /; push(@sub, "$d/$f"); next; } # It's a regular file, ignore it. } closedir(DIR); chdir($root) || die "$root: $!"; foreach (@sub) { &process($_); } print "
\n"; } } # # Walk the directory tree, looking for DESCRIPTION files. $root = `pwd`; chop $root; $f = ''; &process('.'); print STDERR "$files files in $dirs directories\n"; $tail = <<'EOM'; EOM print $tail;