btrbk: bugfix: do not run "rm" command with no arguments (on raw targets)

pull/88/head
Axel Burri 2016-04-06 20:41:14 +02:00
parent 5d65748ffe
commit 6b71b68fcb
1 changed files with 10 additions and 6 deletions

4
btrbk
View File

@ -3861,12 +3861,16 @@ MAIN:
}
my $ret;
if($target_type eq "raw") {
if(scalar(@delete)) {
DEBUG "[raw] delete:";
DEBUG "[raw] file: $_->{PRINT}" foreach(@delete);
$ret = run_cmd({
cmd => ['rm', (map { $_->{PATH} } @delete) ],
rsh => $droot->{RSH},
});
} else {
$ret = 0;
}
}
else {
$ret = btrfs_subvolume_delete(\@delete, commit => config_key($droot, "btrfs_commit_delete"), type => "delete_garbled");