diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-10-03 14:42:24 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-10-03 14:42:24 +0000 |
commit | e9cedd36d5fb1138cbeb57c6071d2188de3a2417 (patch) | |
tree | a63645a2da8822315f62ecb4b52c7d5919f5d78b | |
parent | 7bc02ece0d8c11d2ffd4b45884ebc2a6431e09d5 (diff) | |
download | transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.gz transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.bz2 transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.xz transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.zip |
handle WINNT and lowercase system folder (#34377)
-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 { |