mirror of https://github.com/digint/btrbk
btrbk: fix action origin and ls
Regression: a96c613ab8 btrbk: add subvol_args_init: map subvol_args cmdline arguments into vinfopull/358/head
parent
53d5536929
commit
33e3dee046
22
btrbk
22
btrbk
|
@ -5206,11 +5206,8 @@ sub _origin_tree
|
||||||
# note: root subvolumes dont have REL_PATH
|
# note: root subvolumes dont have REL_PATH
|
||||||
$nodelist //= [ (sort { ($a->{REL_PATH} // "") cmp ($b->{REL_PATH} // "") } values %uuid_cache) ];
|
$nodelist //= [ (sort { ($a->{REL_PATH} // "") cmp ($b->{REL_PATH} // "") } values %uuid_cache) ];
|
||||||
|
|
||||||
my $out_path;
|
|
||||||
$out_path = _fs_path($node);
|
|
||||||
|
|
||||||
my $prefix_spaces = ' ' x (($depth * 4) - ($prefix ? 4 : 0));
|
my $prefix_spaces = ' ' x (($depth * 4) - ($prefix ? 4 : 0));
|
||||||
push(@$lines, { tree => "${prefix_spaces}${prefix}$out_path",
|
push(@$lines, { tree => "${prefix_spaces}${prefix}" . _fs_path($node),
|
||||||
uuid => $node->{uuid},
|
uuid => $node->{uuid},
|
||||||
parent_uuid => $node->{parent_uuid},
|
parent_uuid => $node->{parent_uuid},
|
||||||
received_uuid => $node->{received_uuid},
|
received_uuid => $node->{received_uuid},
|
||||||
|
@ -5480,6 +5477,7 @@ MAIN:
|
||||||
elsif ($command eq "origin") {
|
elsif ($command eq "origin") {
|
||||||
$action_origin = 1;
|
$action_origin = 1;
|
||||||
$args_expected_min = $args_expected_max = 1;
|
$args_expected_min = $args_expected_max = 1;
|
||||||
|
$subvol_args_init = "deny_root_subvol";
|
||||||
@subvol_args = @ARGV;
|
@subvol_args = @ARGV;
|
||||||
}
|
}
|
||||||
elsif($command eq "list") {
|
elsif($command eq "list") {
|
||||||
|
@ -5857,9 +5855,7 @@ MAIN:
|
||||||
#
|
#
|
||||||
my $exit_status = 0;
|
my $exit_status = 0;
|
||||||
my %data_uniq;
|
my %data_uniq;
|
||||||
foreach my $url (@subvol_args) {
|
foreach my $root_vol (@subvol_args) {
|
||||||
my $root_vol = vinfo($url, $config);
|
|
||||||
|
|
||||||
# map url to real path (we need to match against mount points below)
|
# map url to real path (we need to match against mount points below)
|
||||||
my $root_path = system_realpath($root_vol);
|
my $root_path = system_realpath($root_vol);
|
||||||
unless($root_path) {
|
unless($root_path) {
|
||||||
|
@ -6684,17 +6680,7 @@ MAIN:
|
||||||
#
|
#
|
||||||
# print origin information
|
# print origin information
|
||||||
#
|
#
|
||||||
my $url = $subvol_args[0] || die;
|
my $vol = $subvol_args[0] || die;
|
||||||
my $vol = vinfo($url, $config);
|
|
||||||
unless(vinfo_init_root($vol)) {
|
|
||||||
ERROR "Failed to fetch subvolume detail for: $url", @stderr;
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
if($vol->{node}{is_root}) {
|
|
||||||
ERROR "Subvolume is btrfs root: $url\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $lines = [];
|
my $lines = [];
|
||||||
_origin_tree("", $vol->{node}, $lines);
|
_origin_tree("", $vol->{node}, $lines);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue