From 91acd4c6328e2c8c45e08af9b59131a022f56267 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 7 Sep 2010 11:14:52 -0700 Subject: [PATCH] Don't be overzealous in cleaning up the cache root directory. Fixes bug #11814 --- docs/changelog/7.x.x.txt | 1 + sbin/upgrade.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 64585d283..7b45dd143 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,7 @@ - fixed #11832: Admin Session Interface broken - fixed: Attachment label in the Template is missing - fixed #11810: Attachment list broken in template + - fixed #11814: upgrade script removes cache too aggresively (Ernesto Hernández-Novich) 7.9.13 - fixed #11783: Instances deleted during realtime run diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 5c3941d83..a4e2dd0bb 100755 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -144,10 +144,10 @@ foreach my $filename (keys %{$configs}) { unless ($skipDelete) { print "\tDeleting temp files.\n" unless ($quiet); my $path = $configs->{$filename}->get("uploadsPath").$slash."temp"; - File::Path::rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + File::Path::rmtree($path, {keep_root => 1, }) unless ($path eq "" || $path eq "/" || $path eq "/data"); print "\tDeleting file cache.\n" unless ($quiet); $path = $configs->{$filename}->get("fileCacheRoot")||"/tmp/WebGUICache"; - File::Path::rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + File::Path::rmtree($path, {keep_root => 1, }) unless ($path eq "" || $path eq "/" || $path eq "/data"); } } $session->close();