aboutsummaryrefslogtreecommitdiffstats
path: root/transfugdrake.pm
diff options
context:
space:
mode:
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 {