replace backtick operator with run3
This commit is contained in:
committed by
Jörg Thalheim
parent
38b4d5fa0f
commit
29734ae51f
@@ -12,12 +12,14 @@ use Nix::Store;
|
||||
use Encode;
|
||||
use Sys::Hostname::Long;
|
||||
use IPC::Run;
|
||||
use IPC::Run3;
|
||||
use LWP::UserAgent;
|
||||
use JSON::MaybeXS;
|
||||
use UUID4::Tiny qw(is_uuid4_string);
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(
|
||||
addToStore
|
||||
cancelBuilds
|
||||
constructRunCommandLogPath
|
||||
findLog
|
||||
@@ -614,4 +616,14 @@ sub constructRunCommandLogPath {
|
||||
return "$hydra_path/runcommand-logs/$bucket/$uuid";
|
||||
}
|
||||
|
||||
|
||||
sub addToStore {
|
||||
my ($path) = @_;
|
||||
|
||||
my ($stdout, $stderr);
|
||||
run3(['nix-store', '--add', $path], \undef, \$stdout, \$stderr);
|
||||
die "cannot add path $path to the Nix store: $stderr\n" if $? != 0;
|
||||
return trim($stdout);
|
||||
}
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user