From 16cfb600b72ac73e6e3ed5946fd358b6384c6637 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 7 Jun 2015 11:52:39 +0200 Subject: [PATCH] btrbk: workaround for btrfs-progs < 3.17.3 (returns exit status 0 on errors for "btrfs subvolume show") --- ChangeLog | 4 ++++ btrbk | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 664f277..a988fec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +btrbk-current + + * Bugfix: fix crash when using btrfs-progs < 3.17.3 (closes: #24). + btrbk-0.19.1 * Use "cgen" for snapshot comparison. diff --git a/btrbk b/btrbk index 162a9fc..76df0f5 100755 --- a/btrbk +++ b/btrbk @@ -625,6 +625,12 @@ sub btrfs_subvolume_detail($) my $ret = run_cmd("$rsh btrfs subvolume show '$path'", non_destructive => 1, catch_stderr => 1); return undef unless(defined($ret)); + # workaround for btrfs-progs < 3.17.3 (returns exit status 0 on errors) + if($ret =~ /^ERROR: (.*)/) { + $err = $1; + return undef; + } + my $real_path; if($ret =~ /^($file_match)/) { $real_path = $1;