From 6f66f72c26461090f1af6e9e754a2ea7c98665a2 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Mon, 1 Feb 2016 17:05:12 +0100 Subject: [PATCH] btrbk: bugfix: fix checks on "btrfs sub show" output, which resulted in breakage on btrfs-progs < 4.1 --- ChangeLog | 5 +++++ btrbk | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b604a6a..2380c26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +btrbk-current + + * Bugfix: fix checks on "btrfs sub show" output, which resulted in + breakage on btrfs-progs < 4.1 (close: #68). + btrbk-0.22.1 * Support for btrfs-progs v4.4 (close: #66). diff --git a/btrbk b/btrbk index f928412..3e6f8c1 100755 --- a/btrbk +++ b/btrbk @@ -48,7 +48,7 @@ use Getopt::Long qw(GetOptions); use POSIX qw(strftime); use Data::Dumper; -our $VERSION = "0.22.1"; +our $VERSION = "0.22.2-dev"; our $AUTHOR = 'Axel Burri '; our $PROJECT_HOME = ''; @@ -987,6 +987,8 @@ sub btrfs_filesystem_usage($) } +# returns hashref with keys: (name uuid parent_uuid id gen cgen top_level) +# for btrfs-progs >= 4.1, also returns key: "received_uuid" sub btrfs_subvolume_detail($) { my $vol = shift || die; @@ -1042,8 +1044,9 @@ sub btrfs_subvolume_detail($) } elsif($ret =~ /^$real_path/) { TRACE "btr_detail: found btrfs subvolume: $vol->{PRINT}"; + # NOTE: received_uuid is not required here, as btrfs-progs < 4.1 does not give us that information. + # no worries, we get this from btrfs_subvolume_list() for all subvols. my @required_keys = qw(name uuid parent_uuid id gen cgen top_level); - push(@required_keys, "received_uuid") unless($vol->{BTRFS_PROGS_COMPAT}); my %trans = ( "Name" => "name", "uuid" => "uuid",