File::Slurp -> File::Slurper

This commit is contained in:
Graham Christensen 2021-09-06 21:44:46 -04:00
parent c54629b732
commit c880888f1e
9 changed files with 10 additions and 14 deletions

View file

@ -454,7 +454,7 @@
DigestSHA1
EmailMIME
EmailSender
FileSlurp
FileSlurper
FileWhich
final.nix.perl-bindings
git

View file

@ -12,7 +12,6 @@ use JSON::Any;
use DateTime;
use Digest::SHA qw(sha256_hex);
use Text::Diff;
use File::Slurp;
use IPC::Run qw(run);

View file

@ -8,7 +8,6 @@ use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
use File::Basename;
use File::stat;
use File::Slurp;
use Data::Dump qw(dump);
use Nix::Store;
use Nix::Config;

View file

@ -4,7 +4,7 @@ use utf8;
use strict;
use warnings;
use base 'Hydra::Base::Controller::REST';
use File::Slurp;
use File::Slurper qw(read_text);
use Crypt::RandPasswd;
use Digest::SHA1 qw(sha1_hex);
use Hydra::Helper::Nix;
@ -165,7 +165,7 @@ sub github_login :Path('/github-login') Args(0) {
my $client_id = $c->config->{github_client_id} or die "github_client_id not configured.";
my $client_secret = $c->config->{github_client_secret} // do {
my $client_secret_file = $c->config->{github_client_secret_file} or die "github_client_secret nor github_client_secret_file is configured.";
my $client_secret = read_file($client_secret_file);
my $client_secret = read_text($client_secret_file);
$client_secret =~ s/\s+//;
$client_secret;
};

View file

@ -15,7 +15,6 @@ use File::stat;
use File::Path;
use File::Temp;
use File::Spec;
use File::Slurp;
use Hydra::Helper::CatalystUtils;
our @ISA = qw(Exporter);

View file

@ -5,7 +5,6 @@ use warnings;
use Email::MIME;
use Email::Sender::Simple qw(sendmail);
use Exporter 'import';
use File::Slurp;
use Hydra::Helper::Nix;
use Sys::Hostname::Long;

View file

@ -7,7 +7,7 @@ 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;
@ -569,7 +569,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 {

View file

@ -5,7 +5,7 @@ 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);
@ -25,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);
@ -58,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;

View file

@ -5,7 +5,7 @@ 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);
@ -93,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);