btrbk: print "Dryrun: YES" in backup summary header if dryrun is set

pull/57/head
Axel Burri 2015-10-10 15:13:32 +02:00
parent 1905d80969
commit d445dd0b12
1 changed files with 14 additions and 13 deletions

27
btrbk
View File

@ -1599,19 +1599,20 @@ sub print_header(@)
} }
if($config) { if($config) {
print " Config: $config->{SRC_FILE}\n"; print " Config: $config->{SRC_FILE}\n";
}
if($config->{CMDLINE_FILTER_LIST}) if($dryrun) {
{ print " Dryrun: YES\n";
my @list = sort @{$config->{CMDLINE_FILTER_LIST}}; }
my @sorted = ( grep(/^group/, @list), if($config && $config->{CMDLINE_FILTER_LIST}) {
grep(/^volume/, @list), my @list = sort @{$config->{CMDLINE_FILTER_LIST}};
grep(/^subvolume/, @list), my @sorted = ( grep(/^group/, @list),
grep(/^target/, @list) ); grep(/^volume/, @list),
die unless(scalar(@list) == scalar(@sorted)); grep(/^subvolume/, @list),
print " Filter: "; grep(/^target/, @list) );
print join("\n ", @sorted); die unless(scalar(@list) == scalar(@sorted));
print "\n"; print " Filter: ";
} print join("\n ", @sorted);
print "\n";
} }
if($args{info}) { if($args{info}) {
print "\n" . join("\n", grep(defined, @{$args{info}})) . "\n"; print "\n" . join("\n", grep(defined, @{$args{info}})) . "\n";