[Collab-qa-commits] r1234 - buildstat/trunk/buildstat-server/lib/SvnBuildStat/Controller
goneri at alioth.debian.org
goneri at alioth.debian.org
Sun Sep 7 21:57:49 UTC 2008
Author: goneri
Date: 2008-09-07 21:57:48 +0000 (Sun, 07 Sep 2008)
New Revision: 1234
Modified:
buildstat/trunk/buildstat-server/lib/SvnBuildStat/Controller/Controls.pm
Log:
add the 'both' to get .deb and source
Modified: buildstat/trunk/buildstat-server/lib/SvnBuildStat/Controller/Controls.pm
===================================================================
--- buildstat/trunk/buildstat-server/lib/SvnBuildStat/Controller/Controls.pm 2008-09-07 21:55:09 UTC (rev 1233)
+++ buildstat/trunk/buildstat-server/lib/SvnBuildStat/Controller/Controls.pm 2008-09-07 21:57:48 UTC (rev 1234)
@@ -132,7 +132,7 @@
}
die "qatool key missing" unless $params->{qatool};
- die "invalide target" unless $params->{target} =~ /^(source|binary|apt-get)$/;
+ die "invalide target" unless $params->{target} =~ /^(source|binary|both)$/;
my $qatool = $c->model('SvnBuildStat::Model::DB::Qatool')->find_or_create(name => $params->{qatool});
@@ -227,7 +227,59 @@
";
+ $request{both} = "
+SELECT
+ changelogentry.id AS changelogentry_id,
+ changelogentry.changesuri AS changesuri,
+ changelogentry.dscuri AS dscuri,
+ build.id AS build_id,
+ vcs.name AS vcs_name,
+ sourcepackage.name AS sourcepackage_name,
+ repository.uri AS repository_uri
+FROM
+ changelogentry
+ LEFT JOIN
+ qajob
+ ON
+ qajob.qatool_id=".$qatool->id."
+ AND
+ changelogentry.id=qajob.changelogentry_id
+ LEFT JOIN
+ build
+ ON
+ build.changelogentry_id=changelogentry.id
+ LEFT JOIN
+ repositoryentry
+ ON
+ repositoryentry.changelogentry_id=changelogentry.id
+ LEFT JOIN
+ repository
+ ON
+ repository.id=repositoryentry.repository_id
+ LEFT JOIN
+ vcs
+ ON
+ vcs.id=repository.vcs_id
+ LEFT JOIN
+ sourcepackage
+ ON
+ repositoryentry.sourcepackage_id=sourcepackage.id
+WHERE
+ changelogentry.dscuri IS NOT NULL AND
+ (( vcs.name='apt' )
+ OR
+ ( build.changelogentry_id=changelogentry.id AND isbuildok=true AND changelogentry.changesuri IS NOT NULL ))
+ ORDER BY
+ lastjobstart IS NOT NULL,
+ lastjobstart
+ LIMIT 1
+
+";
+
+
+
+
print STDERR $params->{target}."\n";
my $hashref = $dbh->selectrow_hashref($request{$params->{target}});
@@ -251,13 +303,32 @@
$qajob->lastjobstart("NOW");
$qajob->update;
- $ret .= "qajob_id=".$qajob->id."\ndsc=".$hashref->{dscuri}."\n";
+ $ret .= "qajob_id=".$qajob->id."\ndscuri=".$hashref->{dscuri}."\n";
} elsif ($params->{target} eq 'binary') {
$qajob = $c->model('SvnBuildStat::Model::DB::Qajob')->find_or_create(
qatool_id => $qatool->id,
changelogentry_id => $hashref->{changelogentry_id},
+ build_id => $hashref->{build_id},
+ );
+ $qajob->cookie($cookie);
+ $qajob->lastjobstart("NOW");
+ $qajob->update;
+
+ if ($hashref->{'vcs_name'}) {
+ $ret .= "sourcepackage_name=".$hashref->{sourcepackage_name}."\n";
+ $ret .= "apt=".$hashref->{repository_uri}."\n";
+ } else {
+ $ret .= "changesuri=".$hashref->{changesuri}."\n";
+ }
+
+ $ret .= "qajob_id=".$qajob->id."\n";
+ } elsif ($params->{target} eq 'both') {
+
+ $qajob = $c->model('SvnBuildStat::Model::DB::Qajob')->find_or_create(
+ qatool_id => $qatool->id,
+ changelogentry_id => $hashref->{changelogentry_id},
build_id => $hashref->{build_id},
);
$qajob->cookie($cookie);
@@ -272,9 +343,12 @@
}
- $ret .= "qajob_id=".$qajob->id."\n";
+ $ret .= "qajob_id=".$qajob->id."\ndscuri=".$hashref->{dscuri}."\n";
}
+
+
+
die unless $qajob;
More information about the Collab-qa-commits
mailing list