Really, unlink is destructive, don't do it by default!
This commit is contained in:
parent
101baf1938
commit
872e29b9bc
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@ if (@ARGV < 2) {
|
||||||
|
|
||||||
my($TYPE, $MAILDIR_FOLDER) = ($ARGV[0], $ARGV[1]);
|
my($TYPE, $MAILDIR_FOLDER) = ($ARGV[0], $ARGV[1]);
|
||||||
|
|
||||||
|
die "Bad type, $TYPE" unless $TYPE =~ /^(unlink|svn|print)$/;
|
||||||
my (@dupFolders) = @ARGV[2..$#ARGV];
|
my (@dupFolders) = @ARGV[2..$#ARGV];
|
||||||
|
|
||||||
my %msgs; # indexed by Message-Id
|
my %msgs; # indexed by Message-Id
|
||||||
|
@ -101,10 +102,12 @@ foreach my $dir (@msgDirs) {
|
||||||
system("svn rm \"$existing_file\"");
|
system("svn rm \"$existing_file\"");
|
||||||
die "Unable to unlink file $existing_file: $!"
|
die "Unable to unlink file $existing_file: $!"
|
||||||
unless $? == 0;
|
unless $? == 0;
|
||||||
} else {
|
} elsif ($TYPE eq 'unlink') {
|
||||||
print STDERR "Removing $existing_file\n";
|
print STDERR "Removing $existing_file\n";
|
||||||
die "Unable to unlink $existing_file: $!"
|
die "Unable to unlink $existing_file: $!"
|
||||||
unless unlink($existing_file) == 1;
|
unless unlink($existing_file) == 1;
|
||||||
|
} else {
|
||||||
|
die "doing nothing here, type operation not known: $TYPE";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$msgs{$id} = $fields;
|
$msgs{$id} = $fields;
|
||||||
|
|
Loading…
Add table
Reference in a new issue