]> git.donarmstrong.com Git - debbugs.git/blobdiff - debian/debbugsconfig
unfinalize; document XSS fix
[debbugs.git] / debian / debbugsconfig
index 7959ce9113a3d7455524985b46ac51c7ce0a3a0e..e98decc7255d402110ff6e19daa4af8bc302a57f 100755 (executable)
@@ -1,8 +1,13 @@
 #!/usr/bin/perl
 # debbugsconfig: copies debbugs configuration files from templates, and
 #                creates documentation in HTML and text
+# Copyright (C) 1999 Darren Benham
+# Copyright (C) 2000 Josip Rodin
+# Licensed under the version 2 of the GNU General Public License as
+# published by the Free Software Foundation
 
 use POSIX qw(strftime);
+use File::Path;
 
 if (@ARGV) {
   print STDOUT <<EOF;
@@ -31,6 +36,14 @@ require "text";
 &template("sources", "$gConfigDir/indices");
 
 &template("nextnumber", $gSpoolDir);
+&touch("$gSpoolDir/index.archive.realtime");
+&touch("$gSpoolDir/index.db.realtime");
+print "Creating directories in $gSpoolDir:\n";
+for my $num (0 .. 99) {
+  &spooldirectory(sprintf('archive/%02d', $num));
+  &spooldirectory(sprintf('db-h/%02d', $num));
+}
+print "\n";
 
 # stuff used when testing (comment out the above)
 #unshift @INC, "../";
@@ -72,6 +85,23 @@ sub template {
   }
 } 
 
+sub touch {
+  my $name = shift;
+  unless (-f $name) {
+    open TOUCH, ">> $name" or die "open $name: $!";
+    close TOUCH;
+    print "created empty $name.\n";
+  }
+}
+
+sub spooldirectory {
+  my $name = shift;
+  unless (-d "$gSpoolDir/$name") {
+    mkpath("$gSpoolDir/$name");
+    print "$name ";
+  }
+}
+
 sub writefiles {
   local ($html, $text, $name) = @_;
 # first HTML
@@ -97,7 +127,7 @@ sub writefiles {
       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 ||
+    system ("lynx -nolist -dump -cfg=/dev/null $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!";