[Collab-qa-commits] r1263 - buildstat/trunk/buildstat-server/script
goneri at alioth.debian.org
goneri at alioth.debian.org
Tue Sep 9 14:14:13 UTC 2008
Author: goneri
Date: 2008-09-09 14:14:11 +0000 (Tue, 09 Sep 2008)
New Revision: 1263
Modified:
buildstat/trunk/buildstat-server/script/svnbuildstat_import-new-report.pl
Log:
attach a build to the correct host
Modified: buildstat/trunk/buildstat-server/script/svnbuildstat_import-new-report.pl
===================================================================
--- buildstat/trunk/buildstat-server/script/svnbuildstat_import-new-report.pl 2008-09-09 13:08:01 UTC (rev 1262)
+++ buildstat/trunk/buildstat-server/script/svnbuildstat_import-new-report.pl 2008-09-09 14:14:11 UTC (rev 1263)
@@ -107,6 +107,7 @@
return unless /\.info$/;
my $dir = $File::Find::dir;
+ my $hostIP = basename ($dir);
print $File::Find::name."\n";
@@ -119,6 +120,12 @@
}
my $arch = $schema->resultset('Arch')->find_or_create(name => $infofile->{arch});
+ my $host = $schema->resultset('Host')->search(ip => $hostIP)->first;
+ if (!$host) {
+ error ("Can't find the host for ".$hostIP);
+ cleanUp ($dir, $infofile);
+ return;
+ }
my $changelogentry = $schema->resultset('Changelogentry')->search(id => $infofile->{id})->first;
if (!$changelogentry) {
error ("Can't find the changelogentry ".$infofile->{id});
@@ -131,6 +138,7 @@
my $logfileok = 1;
foreach (<LOGFILE>) {
+ # The tarball is broken...
$logfileok = 0 if /tar: Error is not recoverable: exiting now/;
}
@@ -158,7 +166,7 @@
my $build = $schema->resultset('Build')->create({
changelogentry_id => $changelogentry->id,
arch_id => $arch->id,
-# host_id => $host TODO
+ host_id => $host->id,
});
$build->time('now');
More information about the Collab-qa-commits
mailing list