Skip to content

Commit

Permalink
Merge pull request #3263 from dilyanpalauzov/mkimap_improve
Browse files Browse the repository at this point in the history
tools/mkimap: report clearly missing 'configdirectory:' in imapd.conf
  • Loading branch information
elliefm authored Feb 28, 2021
2 parents c2667a2 + 0ea353d commit db061d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tools/mkimap
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ sub read_conf {
if (/^#/) {
next;
}
if (/\@include:\s+(.*)$/) {
print "i will include configure file $1.\n";
if (/\@include:\s*(.*)$/) {
print "I will include configure file $1.\n";
push @configs, $1;
}
if (/^configdirectory:\s+(.*)$/) {
if (/^configdirectory:\s*(.*)$/) {
$confdir = $1;
print "i will configure directory $confdir.\n";
print "I will configure directory $confdir.\n";
}
if (/^(?:meta)?partition-.*:\s+(.*)$/) {
if (/^(?:meta)?partition-.*:\s*(.*)$/) {
if (grep /$1/, @parts) {
next;
}
print "i saw partition $1.\n";
print "I saw partition $1.\n";
push @parts, $1;
}
}
Expand All @@ -81,6 +81,8 @@ while ($conf = shift @configs) {
read_conf($conf);
}

defined $confdir or die "'configdirectory:' in $imapdconf is missing";
@parts or die "No partition defined in $imapdconf";
$d = $confdir;

print "configuring $d...\n";
Expand Down

0 comments on commit db061d8

Please sign in to comment.