diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 52689538b..d8ce8fa4f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -15,6 +15,7 @@ - fixed: Fixed bad gateway macros in the Matrix templates. - fixed #9535: Bad characters in dom element ids when generated from assetId - fixed #9542: Default WebGUI config contains invalid workflow activity + - fixed #9623: preload.custom paths not included during upgrade 7.6.10 - fixed #9577: WebGUI::Form::Url::getValue returns blank rather than undef for blank fields diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index d7247ee54..15680c265 100755 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -18,14 +18,21 @@ BEGIN { } use strict; -use DBI; -use File::Path; -use Getopt::Long; -use Pod::Usage; -use WebGUI::Config; -use WebGUI::Session; -use WebGUI::Utility; -use Cwd; +use Cwd (); +use File::Path (); +use Getopt::Long (); +use Pod::Usage (); + +foreach my $libDir ( readLines( "$webguiRoot/sbin/preload.custom" ) ) { + if ( !-d $libDir ) { + warn "WARNING: Not adding lib directory '$libDir' from $webguiRoot/sbin/preload.custom: Directory does not exist.\n"; + next; + } + unshift @INC, $libDir; +} + +require WebGUI::Config; +require WebGUI::Session; my $help; my $history; @@ -39,7 +46,7 @@ my $skipDelete; my $skipMaintenance; my $doit; -GetOptions( +Getopt::Long::GetOptions( 'help'=>\$help, 'history'=>\$history, 'override'=>\$override, @@ -53,8 +60,8 @@ GetOptions( 'skipbackup'=>\$skipBackup ); -pod2usage( verbose => 2 ) if $help; -pod2usage() unless $doit; +Pod::Usage::pod2usage( verbose => 2 ) if $help; +Pod::Usage::pod2usage() unless $doit; unless ($doit) { print <{$filename}->get("uploadsPath").$slash."temp"; - rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + File::Path::rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); print "\tDeleting file cache.\n" unless ($quiet); $path = $configs->{$filename}->get("fileCacheRoot")||"/tmp/WebGUICache"; - rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + File::Path::rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); } } $session->close(); @@ -193,7 +200,7 @@ print "\nREADY TO BEGIN UPGRADES\n" unless ($quiet); my $notRun = 1; -my $currentPath = getcwd(); +my $currentPath = Cwd::getcwd(); foreach my $filename (keys %config) { chdir($upgradesPath); my $clicmd = $config{$filename}{mysqlCLI} || $mysql; @@ -370,6 +377,22 @@ sub _parseDSN { return $hash; } +sub readLines { + my $file = shift; + my @lines; + if (open(my $fh, '<', $file)) { + while (my $line = <$fh>) { + $line =~ s/#.*//; + $line =~ s/^\s+//; + $line =~ s/\s+$//; + next if !$line; + push @lines, $line; + } + close $fh; + } + return @lines; +} + __END__ =head1 NAME