mirror of https://github.com/digint/btrbk
btrbk: remove obsolete realpath_cache update in btrfs_subvolume_show()
Recent btrfs-progs do not print the real path any more, this is now handled by btrfs_mountpoint() -> system_realpath().pull/245/head
parent
177671e920
commit
1aa0fe1aad
19
btrbk
19
btrbk
|
@ -912,22 +912,9 @@ sub btrfs_subvolume_show($)
|
|||
return undef;
|
||||
}
|
||||
|
||||
if($ret_lines[0] =~ /^($file_match)/) {
|
||||
# use the resolved full path for realpath_cache (if present)
|
||||
# btrfs-progs < 4.12 prints the full (absolute, resolved) path
|
||||
# btrfs-progs >= 4.12 prints the relative path to btrfs root (or "/" if it is the root)
|
||||
my $real_or_rel_path = $1;
|
||||
if($real_or_rel_path ne '/') {
|
||||
my $real_path = check_file($real_or_rel_path, { absolute => 1 }, sanitize => 1); # returns undef if not absolute
|
||||
if($real_path && ($real_path ne $path)) {
|
||||
DEBUG "Real path for subvolume \"$vol->{PRINT}\" is: $real_path";
|
||||
$realpath_cache{$vol->{URL}} = $real_path;
|
||||
}
|
||||
}
|
||||
else {
|
||||
DEBUG "No real path provided by \"btrfs subvolume show\" for subvolume \"$vol->{PRINT}\"";
|
||||
}
|
||||
}
|
||||
# NOTE: the first line starts with a path:
|
||||
# - btrfs-progs < 4.12 prints the full (absolute, resolved) path
|
||||
# - btrfs-progs >= 4.12 prints the relative path to btrfs root (or "/" if it is the root)
|
||||
|
||||
my %detail;
|
||||
if($ret_lines[0] =~ / is (btrfs root|toplevel subvolume)$/) {
|
||||
|
|
Loading…
Reference in New Issue