From a443999fc60516a35e8a07e13d5407ae380bf206 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 31 Dec 2008 00:44:57 +0000 Subject: [PATCH] Fix chdir problems, now that the config file cache is cleared. --- sbin/upgrade.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 4fb9b6016..b4dc1ec33 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -23,6 +23,7 @@ use Pod::Usage; use WebGUI::Config; use WebGUI::Session; use WebGUI::Utility; +use Cwd; my $help; my $history; @@ -188,9 +189,11 @@ foreach my $file (@files) { print "\nREADY TO BEGIN UPGRADES\n" unless ($quiet); my $notRun = 1; - -chdir($upgradesPath); + + +my $currentPath = getcwd(); foreach my $filename (keys %config) { + chdir($upgradesPath); my $clicmd = $config{$filename}{mysqlCLI} || $mysql; my $dumpcmd = $config{$filename}{mysqlDump} || $mysqldump; my $backupTo = $config{$filename}{backupPath} || $backupDir; @@ -250,6 +253,7 @@ foreach my $filename (keys %config) { $notRun = 0; sleep 1; # Sleep a second to avoid adding asset revisions too quickly } + chdir($currentPath); my $session = WebGUI::Session->open($webguiRoot,$filename); print "\tSetting site upgrade completed..." unless ($quiet); $session->setting->remove('specialState');