aboutsummaryrefslogtreecommitdiffstats
path: root/transfugdrake.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-10-03 14:42:24 +0000
committerOlivier Blin <oblin@mandriva.com>2007-10-03 14:42:24 +0000
commite9cedd36d5fb1138cbeb57c6071d2188de3a2417 (patch)
treea63645a2da8822315f62ecb4b52c7d5919f5d78b /transfugdrake.pm
parent7bc02ece0d8c11d2ffd4b45884ebc2a6431e09d5 (diff)
downloadtransfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar
transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.gz
transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.bz2
transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.tar.xz
transfugdrake-e9cedd36d5fb1138cbeb57c6071d2188de3a2417.zip
handle WINNT and lowercase system folder (#34377)
Diffstat (limited to 'transfugdrake.pm')
-rwxr-xr-xtransfugdrake.pm25
1 files changed, 23 insertions, 2 deletions
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 {