From 56e897befd17af280d1b345506b1c115fcb0c7ff Mon Sep 17 00:00:00 2001 From: "justdave%syndicomm.com" Date: Mon, 2 Dec 2002 01:47:20 +0000 Subject: [PATCH] Bug 177850: checksetup.pl was failing if the user didn't have read permissions to the entire Bugzilla path Patch by Jussi Sirpoma r=justdave, a=justdave --- webtools/bugzilla/checksetup.pl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/webtools/bugzilla/checksetup.pl b/webtools/bugzilla/checksetup.pl index aceb6a706daf..3543b45ee2fe 100755 --- a/webtools/bugzilla/checksetup.pl +++ b/webtools/bugzilla/checksetup.pl @@ -924,17 +924,15 @@ END if (-e 'data/template') { print "Removing existing compiled templates ...\n" unless $silent; - # If File::Path::rmtree reported errors, then I'd use that - use File::Find; - sub remove { - return if $_ eq "."; - if (-d $_) { - rmdir $_ || die "Couldn't rmdir $_: $!\n"; - } else { - unlink $_ || die "Couldn't unlink $_: $!\n"; - } - } - finddepth(\&remove, 'data/template'); + File::Path::rmtree('data/template'); + + #Check that the directory was really removed + if(-e 'data/template') { + print "\n\n"; + print "The data/template directory could not be removed. Please\n"; + print "remove it manually and rerun checksetup.pl.\n\n"; + exit; + } } # Precompile stuff. This speeds up initial access (so the template isn't @@ -994,7 +992,7 @@ END use Cwd; - $::baseDir = getcwd(); + $::baseDir = cwd(); # Don't hang on templates which use the CGI library eval("use CGI qw(-no_debug)");