summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-09-28 14:48:41 +0000
committeriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-09-28 14:48:41 +0000
commit8ebd5390305f61519bcf268d92f498977aa5c8ea (patch)
tree021ba0c40a2ba1ec7dac44edef8586dd83752448
parent6cea6b378b8133eb980785eedc3735a6d9ff5eab (diff)
downloadATCD-8ebd5390305f61519bcf268d92f498977aa5c8ea.tar.gz
ChangeLogTag: Thu Sep 28 14:46:43 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
-rw-r--r--ACE/ChangeLog8
-rwxr-xr-xACE/bin/diff-builds.pl34
2 files changed, 32 insertions, 10 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index dbbf106b6fd..039c34991a9 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,11 @@
+Thu Sep 28 14:46:43 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * bin/diff-builds.pl:
+
+ Updated to fix temporary files creation. Now all those are put
+ in the temporary files directory. Fixed the ability to compare
+ just two dates.
+
Thu Sep 28 13:35:04 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/config-hpux-11.00.h:
diff --git a/ACE/bin/diff-builds.pl b/ACE/bin/diff-builds.pl
index d1932681e4d..7ed8e80e362 100755
--- a/ACE/bin/diff-builds.pl
+++ b/ACE/bin/diff-builds.pl
@@ -5,6 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
+use File::Spec qw/ tmpdir /;
use File::Temp qw/ tempfile tempdir /;
use POSIX qw/ strftime /;
@@ -55,6 +56,9 @@ sub find_closest_earlier {
my $rx = quotemeta ( $file);
my @temp = map { (/${rx}_([_0-9]+)([0-9][0-9]_[0-9][0-9])/ && $1 le $date) ? $1 : undef } @suffixes;
my @temp2 = grep /^[0-9]/, @temp;
+
+ print "Found closest earlier build times for $file on $date is $temp2[0]\n" unless !$debugging;
+
return $temp2[0];
}
@@ -97,8 +101,9 @@ sub load_failed_tests_list ($$)
. find_closest_earlier ($file, $date) . "\n\n"
}
+ my $tmpdir = File::Spec->tmpdir();
my $fullfile = $file .'_' . $date . '_' . $timestamps[0];
- my ($fh, $tmpfile) = tempfile ($fullfile . ".XXXXXX", UNLINK => 1);
+ my ($fh, $tmpfile) = tempfile ($fullfile . ".XXXXXX", UNLINK => 1, DIR => $tmpdir);
print "wget " . $verbose . " \'" .$teststaturl
. $fullfile . ".log\' -O - | sort >\'" . $tmpfile . '\'' . "\n" unless !$debugging;
@@ -114,6 +119,8 @@ sub differentiate ($$)
{
my ($rfiles, $rdates) = @_;
+ print "Differentiating for dates " . join (', ', @$rdates) . "\n" unless !$debugging;
+
open (DIFF, "diff -u \'" . load_failed_tests_list ($rfiles->[0], $rdates->[0])
. "\' \'" . load_failed_tests_list ($rfiles->[1], $rdates->[1]) . "\' 2>&1 |")
|| die "Could not diff the files.\n";
@@ -184,7 +191,11 @@ while ($arg = shift(@ARGV)) {
exit 0;
}
if ($arg eq '-D') {
- push (@dates, shift(@ARGV));
+ my $date = shift(@ARGV);
+ $date =~ s/-/_/g;
+ push (@dates, $date);
+ print "Date=$date\n"
+ unless !$debugging;
}
elsif ($arg eq '-v') {
$verbose = undef;
@@ -200,26 +211,29 @@ while ($arg = shift(@ARGV)) {
}
else {
push (@builds, $arg);
+ print "Build=$arg\n"
+ unless !$debugging;
}
}
# Diff the todays clean builds with the ones from a specific date
-if ($#builds == -1 && $#dates == 0)
+if ($#builds == -1 && $#dates >= 0)
{
- if ($clean_builds_only)
- {
+ if ($clean_builds_only) {
find_builds (\@builds, $cleanbuildsurl, 7);
}
- else
- {
+ else {
find_builds (\@builds, $allbuildsurl, 3);
}
- $dates[1] = strftime ("%Y_%m_%d", gmtime);
+ # only the start date given - implies we should
+ # use the today's date
+ if ($#dates == 0) {
+ $dates[1] = strftime ("%Y_%m_%d", gmtime);
+ }
- foreach $build (@builds)
- {
+ foreach $build (@builds) {
$files[0] = $files[1] = $build;
differentiate (\@files, \@dates);
}