From: cjwatson <>
Date: Sun, 16 Jan 2005 22:27:09 +0000 (-0800)
Subject: [project @ 2005-01-16 14:27:08 by cjwatson]
X-Git-Tag: release/2.6.0~739
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=409c83967026aca934f15de31b43b58c820381f5;p=debbugs.git

[project @ 2005-01-16 14:27:08 by cjwatson]
debbugsconfig creates required directories in $gSpoolDir (closes: #222077).
---

diff --git a/debian/changelog b/debian/changelog
index 4b474b5b..2182a156 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     - Allow # prefix on bug numbers in 'merge' command.
     - Fix some ordering issues in old-style package pages and summaries.
     - Add X-$gProject-PR-Message: headers to all mails sent by service.
+    - debbugsconfig creates required directories in $gSpoolDir
+      (closes: #222077).
 
   * Adam Heath:
     - Rewrite filtering in cgi's common.pl, to make it completely generic.
diff --git a/debian/debbugsconfig b/debian/debbugsconfig
index 518ecece..e98decc7 100755
--- a/debian/debbugsconfig
+++ b/debian/debbugsconfig
@@ -7,6 +7,7 @@
 # published by the Free Software Foundation
 
 use POSIX qw(strftime);
+use File::Path;
 
 if (@ARGV) {
   print STDOUT <<EOF;
@@ -37,6 +38,12 @@ require "text";
 &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, "../";
@@ -87,6 +94,14 @@ sub touch {
   }
 }
 
+sub spooldirectory {
+  my $name = shift;
+  unless (-d "$gSpoolDir/$name") {
+    mkpath("$gSpoolDir/$name");
+    print "$name ";
+  }
+}
+
 sub writefiles {
   local ($html, $text, $name) = @_;
 # first HTML