diff options
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | transfugdrake.pm | 25 |
2 files changed, 25 insertions, 2 deletions
@@ -1,3 +1,5 @@ +- handle WINNT and lowercase system folder (#34377) + 1.0: - really run import if only one linux user and one windows user are detected - do not pop wait messages diff --git a/transfugdrake.pm b/transfugdrake.pm index da1355e..927df51 100755 --- a/transfugdrake.pm +++ b/transfugdrake.pm @@ -4,6 +4,26 @@ use strict; use warnings; use common; +sub get_insensitive_path { + my ($prefix, $path) = @_; + my $full_path = $prefix; + my @path_l = split("/", $path); + foreach my $i (@path_l) { + my $e = find { member($_, lc($i), uc($i)) } all($full_path) + or return; + $full_path .= "/" . $e; + } + return $full_path; +} + +sub get_windows_system_path { + my ($prefix, $suffix) = @_; + foreach my $system (qw(WINDOWS WINNT)) { + my $p = get_insensitive_path($prefix, join("/", $system, $suffix)); + return $p if $p; + } +} + sub get_windows_disk() { require fs; require fs::type; @@ -12,8 +32,9 @@ sub get_windows_disk() { fs::merge_info_from_mtab($fstab); my @win_devices = grep { fs::type::isFat_or_NTFS($_) && fs::type::isMounted($_) } @$fstab; - # FIXME: we should WINNT, ... (see drakfont): - find { -e "$_/WINDOWS/system32/config/software" } map { $_->{mntpoint} } @win_devices; + find { + get_windows_system_path($_, "system32/config/software"); + } map { $_->{mntpoint} } @win_devices; } sub list_windows_users { |