summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-10 07:38:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-10 07:38:18 +0000
commita655b0e1e07efb3fd057f726b85887908d970ba6 (patch)
tree5c22433d00fef31132d1ce790939093b0e3956a2 /perl-install/diskdrake/interactive.pm
parentb026d0fd87157061e0f8e5a31247bec7d08a8394 (diff)
downloaddrakx-a655b0e1e07efb3fd057f726b85887908d970ba6.tar
drakx-a655b0e1e07efb3fd057f726b85887908d970ba6.tar.gz
drakx-a655b0e1e07efb3fd057f726b85887908d970ba6.tar.bz2
drakx-a655b0e1e07efb3fd057f726b85887908d970ba6.tar.xz
drakx-a655b0e1e07efb3fd057f726b85887908d970ba6.zip
- move functions using /proc/partitions out of fsedit to fs::proc_partitions
- remove unneeded "use xxx" - add some "use xxx" (nb: not completly needed because some other modules may do it)
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm26
1 files changed, 25 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 080bb375d..ca5b8f4d4 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -7,6 +7,7 @@ use common;
use fs::type;
use fs::loopback;
use fs::format;
+use fs::mount_options;
use fs;
use partition_table;
use partition_table::raw;
@@ -258,7 +259,7 @@ sub general_possible_actions {
sub Undo {
my ($_in, $all_hds) = @_;
- fsedit::undo($all_hds);
+ undo($all_hds);
}
sub Wizard {
@@ -1313,3 +1314,26 @@ sub update_bootloader_for_renumbered_partitions {
require bootloader;
bootloader::update_for_renumbered_partitions($in, \@renumbering, $all_hds);
}
+
+sub undo_prepare {
+ my ($all_hds) = @_;
+ require Data::Dumper;
+ $Data::Dumper::Purity = 1;
+ foreach (@{$all_hds->{hds}}) {
+ my @h = @$_{@partition_table::fields2save};
+ push @{$_->{undo}}, Data::Dumper->Dump([\@h], ['$h']);
+ }
+}
+sub undo {
+ my ($all_hds) = @_;
+ foreach (@{$all_hds->{hds}}) {
+ my $code = pop @{$_->{undo}} or next;
+ my $h; eval $code;
+ @$_{@partition_table::fields2save} = @$h;
+
+ if ($_->{hasBeenDirty}) {
+ partition_table::will_tell_kernel($_, 'force_reboot'); #- next action needing write_partitions will force it. We can not do it now since more undo may occur, and we must not needReboot now
+ }
+ }
+
+}