btrbk: workaround for btrfs-progs < 3.17.3 (returns exit status 0 on errors for "btrfs subvolume show")

pull/30/head
Axel Burri 2015-06-07 11:52:39 +02:00
parent 5ab5175340
commit 16cfb600b7
2 changed files with 10 additions and 0 deletions

View File

@ -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.

6
btrbk
View File

@ -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;