Make clean.pl work in decoupled setup

Bug #409052
This commit is contained in:
cls%seawood.org 2008-06-23 17:41:19 +00:00
Родитель 5996e3d1c1
Коммит c813e13038
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -21,7 +21,6 @@
# Contributor(s):
use lib "@TINDERBOX_DIR@";
require 'tbglobals.pl'; # for $gzip
use strict;
use Getopt::Std;
@ -29,6 +28,10 @@ my $verbose = 0;
my $tinderboxdir = "@TINDERBOX_DIR@";
chdir $tinderboxdir or die "Couldn't chdir to $tinderboxdir";
# tbglobals.pl must be included after chdir
# so that $::tree_dir is set correctly
require 'tbglobals.pl'; # for $gzip
our ($opt_h, $opt_v);
getopts('hv');
usage() if (defined($opt_h));

Просмотреть файл

@ -786,6 +786,12 @@ sub tb_trim_logs($$$$) {
return if (!defined($days) || !defined($tree) || !defined($verbose) ||
!defined($do_html));
# warn if the directory cannot be found and return
if (! -d "$::tree_dir/$tree") {
warn("Cannot find directory: " . shell_escape("$::tree_dir/$tree"));
return;
}
my $min_date = time - (60*60*24 * $days);
#