diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2009-02-03 10:41:51 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2009-02-03 10:41:51 +0000 |
commit | da9f593e8715b075d0fb84a81de7909b6881bacb (patch) | |
tree | fedf124c0a45e28a8192811293e1e96c2ad04dbe /perl-install/diskdrake/interactive.pm | |
parent | d6d283296829b5acce01a0e9fd3196bcdad83f0c (diff) | |
download | drakx-da9f593e8715b075d0fb84a81de7909b6881bacb.tar drakx-da9f593e8715b075d0fb84a81de7909b6881bacb.tar.gz drakx-da9f593e8715b075d0fb84a81de7909b6881bacb.tar.bz2 drakx-da9f593e8715b075d0fb84a81de7909b6881bacb.tar.xz drakx-da9f593e8715b075d0fb84a81de7909b6881bacb.zip |
allow browsing partitions content to easily select the ones to destroy
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index eaf2c8db4..8c5445f83 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -395,6 +395,7 @@ sub part_possible_actions { $part or return; my %actions = my @l = ( + N_("View") => '!isSwap && !isNonMountable && maybeFormatted', N_("Mount point") => '$part->{real_mntpoint} || (!isBusy && !isSwap && !isNonMountable)', N_("Type") => '!isBusy && $::expert && (!readonly || $part->{pt_type} == 0x83)', N_("Options") => '!isSwap($part) && !isNonMountable && $::expert', @@ -438,6 +439,34 @@ sub part_possible_actions { } } +sub View { + my ($in, $hd, $part, $all_hds) = @_; + my $old_mountpoint = $part->{mntpoint}; + my $old_real_mountpoint = $part->{real_mntpoint}; + my $was_mounted = $part->{isMounted}; + my $mountpoint; + if(!$was_mounted) { + $part->{mntpoint} = '/tmp/mnt_browse'; + $mountpoint = $part->{mntpoint}; + mkdir_p($part->{mntpoint}); + my $w; + fs::mount::part($part, 0, sub { + my ($msg) = @_; + $w ||= $in->wait_message(N("Please wait"), $msg); + $w->set($msg); + }); + } else { + $mountpoint = $part->{real_mntpoint} || $part->{mntpoint}; + } + $in->ask_directory({'directory'=>$part->{mntpoint}}); + if(!$was_mounted) { + fs::mount::umount($part); + $part->{mntpoint} = $old_mountpoint; + $part->{real_mntpoint} = $old_real_mountpoint; + unlink($mountpoint); + } +} + #- in case someone use diskdrake only to create partitions, #- ie without assigning a mount point, #- do not suggest mount points anymore @@ -698,7 +727,7 @@ sub Resize { $nice_resize{fat} = resize_fat::main->new($part->{device}, devices::make($part->{device})); $min = max($min, $nice_resize{fat}->min_size); $max = min($max, $nice_resize{fat}->max_size); - } elsif (member($part->{fs_type}, qw(ext2 ext3))) { # resize2fs is known to be broken regarding extents with ext4 + } elsif (member($part->{fs_type}, qw(ext2 ext3))) { # resize2fs is known to be broken regarding extents with ext4 write_partitions($in, $hd) or return; require diskdrake::resize_ext2; if ($nice_resize{ext2} = diskdrake::resize_ext2->new($part->{device}, devices::make($part->{device}))) { |