btrbk: use transaction for mkdir (cosmetics)

Prints correct "dryrun_success" (instead of "DRYRUN") in transaction
log.
pull/286/head
Axel Burri 2019-04-18 17:28:12 +02:00
parent 3d2936d40c
commit 0a2c5dbfb3
1 changed files with 2 additions and 4 deletions

6
btrbk
View File

@ -1874,13 +1874,11 @@ sub system_mkdir($)
my $vol = shift // die; my $vol = shift // die;
my $path = $vol->{PATH} // die;; my $path = $vol->{PATH} // die;;
INFO "Creating directory: $vol->{PRINT}/"; INFO "Creating directory: $vol->{PRINT}/";
start_transaction("mkdir", vinfo_prefixed_keys("target", $vol));
my $ret = run_cmd(cmd => [ qw(mkdir), '-p', { unsafe => $path } ], my $ret = run_cmd(cmd => [ qw(mkdir), '-p', { unsafe => $path } ],
rsh => vinfo_rsh($vol), rsh => vinfo_rsh($vol),
); );
action("mkdir", end_transaction("mkdir", defined($ret));
vinfo_prefixed_keys("target", $vol),
status => ($dryrun ? "DRYRUN" : (defined($ret) ? "success" : "ERROR")),
);
return undef unless(defined($ret)); return undef unless(defined($ret));
return 1; return 1;
} }