Merge pull request #1003 from DeterminateSystems/perlcritic-level-4
perlcritic: level 4
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Hydra::Model::DB;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Hydra::Schema;
|
||||
use Hydra::Helper::Nix;
|
||||
use Hydra::Model::DB;
|
||||
|
@ -1,5 +1,8 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
BEGIN {
|
||||
$ENV{CATALYST_SCRIPT_GEN} = 40;
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Config::General;
|
||||
use Data::Dump qw(dump);
|
||||
use Digest::SHA qw(sha256_hex);
|
||||
use Encode;
|
||||
use File::Slurp;
|
||||
use File::Slurper qw(read_text);
|
||||
use Hydra::Helper::AddBuilds;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use Hydra::Helper::Email;
|
||||
@ -121,7 +122,8 @@ sub fetchInputBuild {
|
||||
my $versionRE = "(?:[A-Za-z0-9\.\-]+)";
|
||||
|
||||
my $relName = ($prevBuild->releasename or $prevBuild->nixname);
|
||||
my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
|
||||
my $version;
|
||||
$version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
|
||||
|
||||
my $mainOutput = getMainOutput($prevBuild);
|
||||
|
||||
@ -166,7 +168,8 @@ sub fetchInputSystemBuild {
|
||||
my $versionRE = "(?:[A-Za-z0-9\.\-]+)";
|
||||
|
||||
my $relName = ($prevBuild->releasename or $prevBuild->nixname);
|
||||
my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
|
||||
my $version;
|
||||
$version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
|
||||
|
||||
my $input =
|
||||
{ storePath => getMainOutput($prevBuild)->path
|
||||
@ -568,7 +571,7 @@ sub checkJobsetWrapped {
|
||||
die "multiple alternatives for the input containing the declarative project specification are not supported\n"
|
||||
if scalar @declInputs != 1;
|
||||
my $declFile = $declInput->{storePath} . "/" . $project->declfile;
|
||||
my $declText = read_file($declFile)
|
||||
my $declText = read_text($declFile)
|
||||
or die "Couldn't read declarative specification file $declFile: $!\n";
|
||||
my $declSpec;
|
||||
eval {
|
||||
|
@ -1,10 +1,11 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Hydra::Schema;
|
||||
use Hydra::Helper::Nix;
|
||||
use Hydra::Model::DB;
|
||||
use File::Slurp;
|
||||
use File::Slurper qw(read_text);
|
||||
use SQL::SplitStatement;
|
||||
use List::Util qw(max);
|
||||
|
||||
@ -24,7 +25,7 @@ my $maxSchemaVersion = max (map { /.*\/upgrade-(\d.*)\.sql/; $1 } (glob "$home/s
|
||||
my @tables = $dbh->tables;
|
||||
if (! grep { /SchemaVersion/i } @tables) {
|
||||
print STDERR "initialising the Hydra database schema...\n";
|
||||
my $schema = read_file(
|
||||
my $schema = read_text(
|
||||
$dbh->{Driver}->{Name} eq 'Pg' ? "$home/sql/hydra.sql" :
|
||||
die "unsupported database type $dbh->{Driver}->{Name}\n");
|
||||
my @statements = $sql_splitter->split($schema);
|
||||
@ -57,7 +58,7 @@ QUOTE
|
||||
for (my $n = $schemaVersion; $n < $maxSchemaVersion; $n++) {
|
||||
my $m = $n + 1;
|
||||
print STDERR "upgrading Hydra schema from version $n to $m\n";
|
||||
my $schema = read_file("$home/sql/upgrade-$m.sql");
|
||||
my $schema = read_text("$home/sql/upgrade-$m.sql");
|
||||
my @statements = $sql_splitter->split($schema);
|
||||
eval {
|
||||
$dbh->begin_work;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Getopt::Long;
|
||||
use HTTP::Server::PSGI;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
use Fcntl;
|
||||
use IO::File;
|
||||
@ -25,9 +26,9 @@ my $client = Net::Amazon::S3::Client->new( s3 => Net::Amazon::S3->new( retry =>
|
||||
my $db = Hydra::Model::DB->new();
|
||||
|
||||
my $gcRootsDir = getGCRootsDir;
|
||||
opendir DIR, $gcRootsDir or die;
|
||||
my @roots = readdir DIR;
|
||||
closedir DIR;
|
||||
opendir my $dir, $gcRootsDir or die;
|
||||
my @roots = readdir $dir;
|
||||
closedir $dir;
|
||||
|
||||
my @actual_roots = ();
|
||||
foreach my $link (@roots) {
|
||||
|
@ -1,10 +1,11 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Hydra::Helper::Nix;
|
||||
use Net::Statsd;
|
||||
use File::Slurp;
|
||||
use File::Slurper qw(read_text);
|
||||
use JSON;
|
||||
use Getopt::Long qw(:config gnu_getopt);
|
||||
|
||||
@ -92,7 +93,7 @@ while (1) {
|
||||
1;
|
||||
} or do { warn "$@"; };
|
||||
|
||||
my $meminfo = read_file("/proc/meminfo", err_mode => 'quiet') // "";
|
||||
my $meminfo = read_text("/proc/meminfo") // "";
|
||||
$meminfo =~ m/Dirty:\s*(\d+) kB/;
|
||||
if (defined $1) {
|
||||
my $dirty = $1 / (1024.0 * 1024.0);
|
||||
|
@ -1,5 +1,8 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
BEGIN {
|
||||
$ENV{CATALYST_SCRIPT_GEN} = 40;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Path;
|
||||
use File::stat;
|
||||
use File::Basename;
|
||||
@ -62,9 +63,9 @@ sub keepBuild {
|
||||
# Read the current GC roots.
|
||||
print STDERR "*** reading current roots...\n";
|
||||
my $gcRootsDir = getGCRootsDir;
|
||||
opendir DIR, $gcRootsDir or die;
|
||||
my @roots = readdir DIR;
|
||||
closedir DIR;
|
||||
opendir my $dir, $gcRootsDir or die;
|
||||
my @roots = readdir $dir;
|
||||
closedir $dir;
|
||||
|
||||
|
||||
# For scheduled builds, we register the derivation as a GC root.
|
||||
|
Reference in New Issue
Block a user