#!/usr/bin/perl # debbugsconfig: copies debbugs configuration files from templates, and # creates documentation in HTML and text use POSIX qw(strftime); if (@ARGV) { print STDOUT <$gWebDir/$html.html") || die "\n$gWebDir/$html.html: $!"; print DEST $name; close(DEST); print "$html.html "; # now text return if ($text eq ""); # for index.html # This should be done with pipes instead of a temporary files, but lynx # doesn't read HTML from stdin :/ open(DEST, ">$gDocDir/$text.html") || die "\n$gDocDir/$text.html: $!"; $name =~ s,\nOther pages:\n.*?
,,si; print DEST $name; close(DEST); unlink("$gDocDir/$text.txt"); $ENV{'HOME'} = "/tmp"; $ENV{'TERM'} = "linux"; if (-x "/usr/bin/links") { system ("rm -rf /tmp/.links/") == 0 || die; system ("links -dump $gDocDir/$text.html > $gDocDir/$text.txt") == 0 || die "\nunable to write $gDocDir/$text.txt\n"; system ("rm -rf /tmp/.links/"); } elsif (-x "/usr/bin/lynx") { system ("lynx -nolist -dump -cfg=$gConfigDir/html/lynx-cfg $gDocDir/$text.html > $gDocDir/$text.txt") == 0 || die "\nunable to write $gDocDir/$text.txt\n"; } else { print "unable to write text versions of the HTMLs!"; print "if you need them, install links or lynx and run debbugsconfig again"; return; } unlink("$gDocDir/$text.html") || die "\ncan't remove temporary file $gDocDir/$text.html: $!"; print "$text.txt "; }