aboutsummaryrefslogtreecommitdiffstats
path: root/transfugdrake
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-07-31 15:23:26 +0000
committerOlivier Blin <oblin@mandriva.com>2007-07-31 15:23:26 +0000
commita9e3d6a8465c3cd53eed82431b2467a169bf7adf (patch)
tree537a38b2e8672104f219f6a5d5c8ad4e94566e03 /transfugdrake
parente68217f3e1e3f310a9afbf684a390c28148722f7 (diff)
downloadtransfugdrake-a9e3d6a8465c3cd53eed82431b2467a169bf7adf.tar
transfugdrake-a9e3d6a8465c3cd53eed82431b2467a169bf7adf.tar.gz
transfugdrake-a9e3d6a8465c3cd53eed82431b2467a169bf7adf.tar.bz2
transfugdrake-a9e3d6a8465c3cd53eed82431b2467a169bf7adf.tar.xz
transfugdrake-a9e3d6a8465c3cd53eed82431b2467a169bf7adf.zip
lookup windows disk
Diffstat (limited to 'transfugdrake')
-rwxr-xr-xtransfugdrake17
1 files changed, 17 insertions, 0 deletions
diff --git a/transfugdrake b/transfugdrake
index 7163e92..4812c2a 100755
--- a/transfugdrake
+++ b/transfugdrake
@@ -9,6 +9,7 @@ use interactive;
use common;
my %distrib = distrib();
+my $win_disk = get_windows_disk();
my @linux_users = list_users();
my @windows_users = list_windows_users();
my %windows_bookmarks = list_windows_bookmarks();
@@ -28,6 +29,7 @@ my $wiz = wizards->new({
welcome => {
name => N("This wizard will help you to import Windows documents and settings in your %s distribution.", $distrib{system}) . "\n" . N("It allows two differents migration methods: you can either import all documents and settings by copying them, or share them between operating systems."),
post => sub {
+ $win_disk or return 'no_win';
$linux_user = @linux_users == 1 && $linux_users[0];
$windows_user = @windows_users == 1 && $windows_users[0];
!$linux_user || !$windows_user ? 'users' : 'files';
@@ -126,11 +128,26 @@ my $wiz = wizards->new({
name => N("Congratulations, your migration is now completed!"),
end => 1,
},
+ no_win => {
+ name => N("No Windows installation has been detected."),
+ end => 1,
+ },
},
});
$wiz->process($in);
+sub get_windows_disk {
+ require fs;
+ require fs::type;
+
+ my $fstab = [ fs::read_fstab($::prefix, '/etc/fstab', '') ];
+ fs::merge_info_from_mtab($fstab);
+
+ my @win_devices = grep { fs::type::isFat_or_NTFS($_) && fs::type::isMounted($_) } @$fstab;
+ find { -e "$_/WINDOWS/system32/config/software" } map { $_->{mntpoint} } @win_devices;
+}
+
sub list_windows_users {
my ($win_prefix) = @_;
qw(john alice);