forked from lix-project/hydra
Merge pull request #1043 from DeterminateSystems/perl-warnings
Fixup Perl warnings around undefined variables
This commit is contained in:
commit
f0d0358ee4
|
@ -10,7 +10,7 @@ use Hydra::Helper::CatalystUtils;
|
||||||
|
|
||||||
sub isEnabled {
|
sub isEnabled {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
return $self->{config}->{enable_bitbucket_status} == 1;
|
return ($self->{config}->{enable_bitbucket_status} // 0) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub toBitBucketState {
|
sub toBitBucketState {
|
||||||
|
|
|
@ -53,7 +53,7 @@ sub buildFinished {
|
||||||
my $covTarball;
|
my $covTarball;
|
||||||
|
|
||||||
opendir my $tarballs_handle, $tarballs or die;
|
opendir my $tarballs_handle, $tarballs or die;
|
||||||
while (my $file = readdir $tarballshandle) {
|
while (my $file = readdir $tarballs_handle) {
|
||||||
next unless $file =~ /.*-coverity-int\.(tgz|lzma|xz|bz2|zip)$/;
|
next unless $file =~ /.*-coverity-int\.(tgz|lzma|xz|bz2|zip)$/;
|
||||||
$covTarball = "$tarballs/$file"; last;
|
$covTarball = "$tarballs/$file"; last;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Hydra::Helper::Email;
|
||||||
|
|
||||||
sub isEnabled {
|
sub isEnabled {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
return $self->{config}->{email_notification} == 1;
|
return ($self->{config}->{email_notification} // 0) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $template = <<EOF;
|
my $template = <<EOF;
|
||||||
|
|
|
@ -34,7 +34,7 @@ sub _parseValue {
|
||||||
my $start_options = 3;
|
my $start_options = 3;
|
||||||
# if deepClone has "=" then is considered an option
|
# if deepClone has "=" then is considered an option
|
||||||
# and not the enabling of deepClone
|
# and not the enabling of deepClone
|
||||||
if (index($deepClone, "=") != -1) {
|
if (defined($deepClone) && index($deepClone, "=") != -1) {
|
||||||
undef $deepClone;
|
undef $deepClone;
|
||||||
$start_options = 2;
|
$start_options = 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,8 +97,8 @@ sub _iterate {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub fetchInput {
|
sub fetchInput {
|
||||||
my ($self, $type, $name, $value, $project, $jobset) = @_;
|
my ($self, $input_type, $name, $value, $project, $jobset) = @_;
|
||||||
return undef if $type ne "github_refs";
|
return undef if $input_type ne "github_refs";
|
||||||
|
|
||||||
my ($owner, $repo, $type, $fut, $prefix) = split ' ', $value;
|
my ($owner, $repo, $type, $fut, $prefix) = split ' ', $value;
|
||||||
die "type field is neither 'heads' nor 'tags', but '$type'"
|
die "type field is neither 'heads' nor 'tags', but '$type'"
|
||||||
|
|
|
@ -21,11 +21,18 @@ sub isEnabled {
|
||||||
}
|
}
|
||||||
|
|
||||||
my $client;
|
my $client;
|
||||||
my %compressors = (
|
my %compressors = ();
|
||||||
xz => "| $Nix::Config::xz",
|
|
||||||
bzip2 => "| $Nix::Config::bzip2",
|
$compressors{"none"} = "";
|
||||||
none => ""
|
|
||||||
);
|
if (defined($Nix::Config::bzip2)) {
|
||||||
|
$compressors{"bzip2"} = "| $Nix::Config::bzip2",
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($Nix::Config::xz)) {
|
||||||
|
$compressors{"xz"} = "| $Nix::Config::xz",
|
||||||
|
}
|
||||||
|
|
||||||
my $lockfile = Hydra::Model::DB::getHydraPath . "/.hydra-s3backup.lock";
|
my $lockfile = Hydra::Model::DB::getHydraPath . "/.hydra-s3backup.lock";
|
||||||
|
|
||||||
sub buildFinished {
|
sub buildFinished {
|
||||||
|
|
|
@ -567,7 +567,7 @@ sub checkJobsetWrapped {
|
||||||
my $inputInfo = {};
|
my $inputInfo = {};
|
||||||
if ($jobsetsJobset) {
|
if ($jobsetsJobset) {
|
||||||
my @declInputs = fetchInput($plugins, $db, $project, $jobset, "decl", $project->decltype, $project->declvalue, 0);
|
my @declInputs = fetchInput($plugins, $db, $project, $jobset, "decl", $project->decltype, $project->declvalue, 0);
|
||||||
my $declInput = @declInputs[0] or die "cannot find the input containing the declarative project specification\n";
|
my $declInput = $declInputs[0] or die "cannot find the input containing the declarative project specification\n";
|
||||||
die "multiple alternatives for the input containing the declarative project specification are not supported\n"
|
die "multiple alternatives for the input containing the declarative project specification are not supported\n"
|
||||||
if scalar @declInputs != 1;
|
if scalar @declInputs != 1;
|
||||||
my $declFile = $declInput->{storePath} . "/" . $project->declfile;
|
my $declFile = $declInput->{storePath} . "/" . $project->declfile;
|
||||||
|
|
Loading…
Reference in a new issue