From 2addf97d11faf5d819ccc4820f83a783d5d5bd91 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 4 Dec 2007 16:31:46 +0000 Subject: - diskdrake: o drop "Undo", "Restore partition table", "Save partition table" (preparing to switch to libparted) --- perl-install/partition_table.pm | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 590365536..752fe7088 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -9,8 +9,6 @@ use partition_table::raw; use detect_devices; use log; -our @fields2save = qw(primary extended totalsectors isDirty will_tell_kernel); - sub hd2minimal_part { my ($hd) = @_; @@ -437,7 +435,6 @@ sub write { } } $hd->{isDirty} = 0; - $hd->{hasBeenDirty} = 1; #- used in undo (to know if undo should believe isDirty or not) if (my $tell_kernel = delete $hd->{will_tell_kernel}) { if (fs::type::is_dmraid($hd)) { @@ -604,39 +601,4 @@ sub next_start { $next ? $next->{start} : $hd->last_usable_sector; } -sub load { - my ($hd, $file, $b_force) = @_; - - my $F = ref $file ? $file : common::open_file($file) || die N("Error reading file %s", $file); - - my $h; - { - local $/ = "\0"; - eval <$F>; - } - $@ and die N("Restoring from file %s failed: %s", $file, $@); - - ref($h) eq 'ARRAY' or die N("Bad backup file"); - - my %h; @h{@fields2save} = @$h; - - $h{totalsectors} == $hd->{totalsectors} or $b_force or cdie "bad totalsectors"; - - #- unsure we do not modify totalsectors - local $hd->{totalsectors}; - - @$hd{@fields2save} = @$h; - - delete @$_{qw(isMounted isFormatted notFormatted toFormat toFormatUnsure)} foreach get_normal_parts($hd); - will_tell_kernel($hd, 'force_reboot'); #- just like undo, do not force write_partitions so that user can see the new partition table but can still discard it -} - -sub save { - my ($hd, $file) = @_; - my @h = @$hd{@fields2save}; - require Data::Dumper; - eval { output($file, Data::Dumper->Dump([\@h], ['$h']), "\0") } - or die N("Error writing to file %s", $file); -} - 1; -- cgit v1.2.1