diff options
author | Christian Belisle <cbelisle@mandriva.com> | 2002-01-15 13:18:27 +0000 |
---|---|---|
committer | Christian Belisle <cbelisle@mandriva.com> | 2002-01-15 13:18:27 +0000 |
commit | 41af31a47773b5011d0da431268dec91b63a634d (patch) | |
tree | 58a063cf2471487149f68bbd93c610eb6abbbecb /transfugdrake.pm | |
parent | a952d0ffc8010970c5a51a90d6ec58d5ee03001a (diff) | |
download | transfugdrake-41af31a47773b5011d0da431268dec91b63a634d.tar transfugdrake-41af31a47773b5011d0da431268dec91b63a634d.tar.gz transfugdrake-41af31a47773b5011d0da431268dec91b63a634d.tar.bz2 transfugdrake-41af31a47773b5011d0da431268dec91b63a634d.tar.xz transfugdrake-41af31a47773b5011d0da431268dec91b63a634d.zip |
if already mounted, don't re-mount.
Diffstat (limited to 'transfugdrake.pm')
-rw-r--r-- | transfugdrake.pm | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/transfugdrake.pm b/transfugdrake.pm index 8b5cba6..3217fc5 100644 --- a/transfugdrake.pm +++ b/transfugdrake.pm @@ -116,21 +116,27 @@ sub mount_partition { my $win_partition = $_[1]; my $mountpoint = "/mnt/windows"; my @mounts; + my $mounted = 0; + my @tmp; (@mounts) = cat_('/proc/mounts'); foreach (@mounts) { - print "$_\n"; + @tmp = split(' ', $_); + print "$tmp[0]\n"; + if($tmp[0] eq $win_partition) { $mounted = 1; } } - if(-e $mountpoint) { - $mountpoint .= '2'; - } - mkdir($mountpoint); - - print "mount -t $fstype $win_partition $mountpoint\n"; - #if(`mount -t $fstype $win_partition $mountpoint`) { print "Error\n:"; } + if(!$mounted) { + if(-e $mountpoint) { + $mountpoint .= '2'; + } + mkdir($mountpoint); + print "mount -t $fstype $win_partition $mountpoint\n"; + if(`mount -t $fstype $win_partition $mountpoint`) { print "Error\n:"; } + } + return $mountpoint; } @@ -144,8 +150,6 @@ sub get_windows_config { # Mount it $config->{mountpoint} = mount_partition($config->{fstype}, $config->{partition}); - # Get the Windows version - $config->{version} = $get_windows_version($config->{mountpoint}); # Find where the documents are # If possible, get some registry config return %config; |