mirror of https://github.com/digint/btrbk
btrbk: support btrfs-progs 4.13.2: adapt parsing of "btrfs subvolume list"
btrfs-progs v4.13.2 changed the output of "btrfs subvolume list", in
order to make the tabular output format look nicer (?!?):
e4c6772f69
pull/204/head
parent
e9a517f161
commit
0799820556
|
@ -3,6 +3,8 @@ btrbk-current
|
||||||
* MIGRATION
|
* MIGRATION
|
||||||
- If you are using raw targets, make sure to run the
|
- If you are using raw targets, make sure to run the
|
||||||
"raw_suffix2sidecar" utility in each target directory.
|
"raw_suffix2sidecar" utility in each target directory.
|
||||||
|
* Support for btrfs-progs v4.13.2: adapt parsing of "btrfs sub list"
|
||||||
|
output (close #192).
|
||||||
* Add "resume" command, replacement for "-r, --resume-only" command
|
* Add "resume" command, replacement for "-r, --resume-only" command
|
||||||
line option (which is now deprecated).
|
line option (which is now deprecated).
|
||||||
* Add "snapshot" command (close #150).
|
* Add "snapshot" command (close #150).
|
||||||
|
|
5
btrbk
5
btrbk
|
@ -1001,7 +1001,7 @@ sub btrfs_subvolume_list_readonly_flag($)
|
||||||
my %ro;
|
my %ro;
|
||||||
foreach (split(/\n/, $ret))
|
foreach (split(/\n/, $ret))
|
||||||
{
|
{
|
||||||
die("Failed to parse line: \"$_\"") unless(/^ID ([0-9]+) gen [0-9]+ top level [0-9]+ path /);
|
die("Failed to parse line: \"$_\"") unless(/^ID\s+([0-9]+)\s+gen\s+[0-9]+\s+top level\s+[0-9]+\s+path\s/);
|
||||||
$ro{$1} = 1;
|
$ro{$1} = 1;
|
||||||
}
|
}
|
||||||
DEBUG "Parsed " . scalar(keys %ro) . " readonly subvolumes for filesystem at: $vol->{PRINT}";
|
DEBUG "Parsed " . scalar(keys %ro) . " readonly subvolumes for filesystem at: $vol->{PRINT}";
|
||||||
|
@ -1031,7 +1031,8 @@ sub btrfs_subvolume_list($;@)
|
||||||
foreach (split(/\n/, $ret))
|
foreach (split(/\n/, $ret))
|
||||||
{
|
{
|
||||||
my %node;
|
my %node;
|
||||||
unless(/^ID ([0-9]+) gen ([0-9]+) cgen ([0-9]+) top level ([0-9]+) parent_uuid ([0-9a-z-]+) received_uuid ([0-9a-z-]+) uuid ([0-9a-z-]+) path (.+)$/) {
|
# NOTE: btrfs-progs >= 4.13.2 pads uuid's with 36 whitespaces
|
||||||
|
unless(/^ID\s+([0-9]+)\s+gen\s+([0-9]+)\s+cgen\s+([0-9]+)\s+top level\s+([0-9]+)\s+parent_uuid\s+([0-9a-f-]+)\s+received_uuid\s+([0-9a-f-]+)\s+uuid\s+([0-9a-f-]+)\s+path\s+(.+)$/) {
|
||||||
ERROR "Failed to parse subvolume list (unsupported btrfs-progs) for: $vol->{PRINT}";
|
ERROR "Failed to parse subvolume list (unsupported btrfs-progs) for: $vol->{PRINT}";
|
||||||
DEBUG "Offending line: $_";
|
DEBUG "Offending line: $_";
|
||||||
return undef;
|
return undef;
|
||||||
|
|
Loading…
Reference in New Issue