1
0
Fork 0
mirror of https://github.com/NixOS/hydra.git synced 2024-10-18 17:02:28 -04:00

* Clean up indentation.

This commit is contained in:
Eelco Dolstra 2010-03-05 16:16:49 +00:00
parent 7daca03e78
commit da25c963eb

View file

@ -63,6 +63,7 @@ sub attrsToSQL {
return $query; return $query;
} }
sub fetchInputPath { sub fetchInputPath {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -93,12 +94,11 @@ sub fetchInputPath {
($cachedInput) = $db->resultset('CachedPathInputs')->search( ($cachedInput) = $db->resultset('CachedPathInputs')->search(
{srcpath => $uri, sha256hash => $sha256}); {srcpath => $uri, sha256hash => $sha256});
# Path inputs don't have a natural notion of a "revision", # Path inputs don't have a natural notion of a "revision", so
# so we simulate it by using the timestamp that we first # we simulate it by using the timestamp that we first saw this
# saw this path have this SHA-256 hash. So if the # path have this SHA-256 hash. So if the contents of the path
# contents of the path changes, we get a new "revision", # changes, we get a new "revision", but if it doesn't change
# but if it doesn't change (or changes back), we don't get # (or changes back), we don't get a new "revision".
# a new "revision".
if (!defined $cachedInput) { if (!defined $cachedInput) {
txn_do($db, sub { txn_do($db, sub {
$db->resultset('CachedPathInputs')->create( $db->resultset('CachedPathInputs')->create(
@ -126,6 +126,7 @@ sub fetchInputPath {
}; };
} }
sub fetchInputSVN { sub fetchInputSVN {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -180,6 +181,7 @@ sub fetchInputSVN {
}; };
} }
sub fetchInputBuild { sub fetchInputBuild {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -215,6 +217,7 @@ sub fetchInputBuild {
}; };
} }
sub fetchInputSystemBuild { sub fetchInputSystemBuild {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -227,9 +230,7 @@ sub fetchInputSystemBuild {
my @validBuilds = (); my @validBuilds = ();
foreach my $build (@latestBuilds) { foreach my $build (@latestBuilds) {
if(isValidPath($build->outpath)) { push(@validBuilds, $build) if isValidPath($build->outpath);
push(@validBuilds,$build);
}
} }
if (scalar(@validBuilds) == 0) { if (scalar(@validBuilds) == 0) {
@ -238,6 +239,7 @@ sub fetchInputSystemBuild {
} }
my @inputs = (); my @inputs = ();
foreach my $prevBuild (@validBuilds) { foreach my $prevBuild (@validBuilds) {
my $pkgNameRE = "(?:(?:[A-Za-z0-9]|(?:-[^0-9]))+)"; my $pkgNameRE = "(?:(?:[A-Za-z0-9]|(?:-[^0-9]))+)";
my $versionRE = "(?:[A-Za-z0-9\.\-]+)"; my $versionRE = "(?:[A-Za-z0-9\.\-]+)";
@ -254,9 +256,11 @@ sub fetchInputSystemBuild {
}; };
push(@inputs, $input); push(@inputs, $input);
} }
return @inputs; return @inputs;
} }
sub fetchInputGit { sub fetchInputGit {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -347,13 +351,14 @@ sub fetchInputGit {
, sha256hash => $sha256 , sha256hash => $sha256
, revision => $revision , revision => $revision
}; };
} }
sub fetchInputCVS { sub fetchInputCVS {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
} }
sub fetchInput { sub fetchInput {
my ($db, $project, $jobset, $name, $type, $value) = @_; my ($db, $project, $jobset, $name, $type, $value) = @_;
@ -453,7 +458,7 @@ sub evalJobs {
my $validJob = 1; my $validJob = 1;
foreach my $arg (@{$job->{arg}}) { foreach my $arg (@{$job->{arg}}) {
my $input = $inputInfo->{$arg->{name}}->[$arg->{altnr}] ; my $input = $inputInfo->{$arg->{name}}->[$arg->{altnr}] ;
if($input->{type} eq "sysbuild" && ! ($input->{system} eq $job->{system}) ) { if ($input->{type} eq "sysbuild" && $input->{system} ne $job->{system}) {
$validJob = 0; $validJob = 0;
} }
} }