From ad681cad1e68b1a20fa2b34805859eabace8b722 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 7 Mar 2004 21:02:46 +0000 Subject: [PATCH] changed the upgrade system to die after fatal errors --- docs/changelog/6.x.x.txt | 2 ++ docs/upgrades/upgrade_5.9.9-6.0.0.pl | 1 - sbin/upgrade.pl | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 4473e9bfc..a6da8766f 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -96,4 +96,6 @@ webgui. - Added a view privileges setting to each forum. - Bugfix [ 822805 ] Emptying trash can cause fatal error (Thanks to Steve Simms.) + - Changed the upgrade system to stop after an error so the sys admin can fix + the problem before continuing. diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.pl b/docs/upgrades/upgrade_5.9.9-6.0.0.pl index 4b8269504..dd4c1046a 100644 --- a/docs/upgrades/upgrade_5.9.9-6.0.0.pl +++ b/docs/upgrades/upgrade_5.9.9-6.0.0.pl @@ -1,5 +1,4 @@ #!/usr/bin/perl - use lib "../../lib"; use File::Path; use Getopt::Long; diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 82dd1e78f..d1fb72755 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -221,6 +221,7 @@ foreach my $config (keys %config) { print "OK\n" unless ($quiet); } else { print "Failed!\n" unless ($quiet); + fatalError(); } } print "\tUpgrading to ".$upgrade{$upgrade}{to}."..." unless ($quiet); @@ -232,12 +233,14 @@ foreach my $config (keys %config) { print "OK\n" unless ($quiet); } else { print "Failed!\n" unless ($quiet); + fatalError(); } if ($upgrade{$upgrade}{pl} ne "") { my $cmd = $perl." ".$upgrade{$upgrade}{pl}." --configFile=".$config; $cmd .= " --quiet" if ($quiet); if (system($cmd)) { print "\tProcessing upgrade executable failed!\n"; + fatalError(); } } $config{$config}{version} = $upgrade{$upgrade}{to}; @@ -291,6 +294,18 @@ sub checkVersion { } } +#----------------------------------------- +sub fatalError { + print <