btrbk: bugfix (blocker): btr_fs_info(): return en empty hash if subvolume at $fs_path is empty (bug introduced in: 14e675bacd)

pull/30/head
Axel Burri 2015-03-20 17:56:36 +01:00
parent 9f96974a5d
commit d17d0abff5
2 changed files with 9 additions and 3 deletions

View File

@ -15,4 +15,7 @@
* btrbk-0.13
- bugfix: allow '@' character for subvolume names (blocker for
ubuntu users, since ubuntu prefixes all subvolumes with '@' in its
subvolume layout)
subvolume layout). Fixes issue #3
* btrbk-current
- bugfix: correctly handle empty target subvolumes. Fixes issue #4

7
btrbk
View File

@ -47,7 +47,7 @@ use Date::Calc qw(Today Delta_Days Day_of_Week);
use Getopt::Std;
use Data::Dumper;
our $VERSION = "0.13";
our $VERSION = "0.14-dev";
our $AUTHOR = 'Axel Burri <axel@tty0.ch>';
our $PROJECT_HOME = '<http://www.digint.ch/btrbk/>';
@ -686,6 +686,9 @@ sub _subtree_list
# SUBVOL_PATH relative path to $fs_path
# FS_PATH absolute path
# node href to tree node
#
# returns an empty hash if the subvolume at $fs_path exists, but contains no subvolumes
# returns undef if the subvolume at $fs_path does not exists
sub btr_fs_info($;$)
{
my $fs_path = shift || die;
@ -704,7 +707,7 @@ sub btr_fs_info($;$)
$tree_root = $uuid_info{$detail->{uuid}}->{SUBTREE};
unless($tree_root) {
DEBUG "No subvolumes found in: $fs_path";
return undef;
return {};
}
}