From 2fe429a1283bb382c14b3657ab9f752a8b240233 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 1 Sep 1999 10:21:01 +0000 Subject: no_comment --- perl-install/common.pm | 4 ++-- perl-install/fsedit.pm | 8 +++----- perl-install/install2.pm | 11 +++++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'perl-install') diff --git a/perl-install/common.pm b/perl-install/common.pm index 4220b06d7..fbaf4cd80 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -131,9 +131,9 @@ sub before_leaving(&) { sub catch_cdie(&&) { my ($f, $catch) = @_; + local @common::cdie_catches; unshift @common::cdie_catches, $catch; &$f(); - shift @common::cdie_catches; } sub cdie { @@ -141,7 +141,7 @@ sub cdie { foreach (@common::cdie_catches) { &{$_}(@_) and return; } - die @_; + die join '', @_; } sub all { diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 6d07796d6..fc555c056 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -3,7 +3,7 @@ package fsedit; use diagnostics; use strict; -use common qw(:common :constant); +use common qw(:common :constant :functional); use partition_table qw(:types); use partition_table_raw; use Data::Dumper; @@ -50,10 +50,8 @@ sub hds($$) { eval { partition_table::read($hd, $flags->{clearall}) }; if ($@) { -# $@ =~ /bad magic number/ or die; - $flags->{eraseBadPartitions} ? - partition_table_raw::zero_MBR($hd) : - die; + &cdie($@) unless $flags->{eraseBadPartitions}; + partition_table_raw::zero_MBR($hd); } push @hds, $hd; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 9f64b17ee..bafaa515d 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -4,7 +4,7 @@ use diagnostics; use strict; use vars qw($o); -use common qw(:common :file :system); +use common qw(:common :file :system :functional); use install_any qw(:all); use log; use network; @@ -282,7 +282,14 @@ sub setupSCSI { sub partitionDisks { $o->{drives} = [ detect_devices::hds() ]; - $o->{hds} = fsedit::hds($o->{drives}, $o->{default}{partitioning}); + $o->{hds} = catch_cdie { fsedit::hds($o->{drives}, $o->{default}{partitioning}) } + sub { + $o->ask_warn(_("Error"), +_("I can't read your partition table, it's too corrupted for me :( +I'll try to go on blanking bad partitions")); + 1; + }; + unless (@{$o->{hds}} > 0) { $o->setupSCSI if $o->{autoSCSI}; # ask for an unautodetected scsi card } -- cgit v1.2.1