diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-12-04 16:31:46 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-12-04 16:31:46 +0000 |
commit | 2addf97d11faf5d819ccc4820f83a783d5d5bd91 (patch) | |
tree | 481349e8b8392d90da6ce05c862f4a926efa22d5 /perl-install/partition_table.pm | |
parent | ec329cc4150b3db24c196c46b5e84d38a3a98259 (diff) | |
download | drakx-2addf97d11faf5d819ccc4820f83a783d5d5bd91.tar drakx-2addf97d11faf5d819ccc4820f83a783d5d5bd91.tar.gz drakx-2addf97d11faf5d819ccc4820f83a783d5d5bd91.tar.bz2 drakx-2addf97d11faf5d819ccc4820f83a783d5d5bd91.tar.xz drakx-2addf97d11faf5d819ccc4820f83a783d5d5bd91.zip |
- diskdrake:
o drop "Undo", "Restore partition table", "Save partition table"
(preparing to switch to libparted)
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r-- | perl-install/partition_table.pm | 38 |
1 files changed, 0 insertions, 38 deletions
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; |