Use the new Nix Perl bindings

This commit is contained in:
Eelco Dolstra
2011-11-30 15:25:28 +01:00
parent 5333c67bf9
commit c613b885f2
8 changed files with 12 additions and 17 deletions

View File

@ -5,6 +5,7 @@ use feature 'switch';
use XML::Simple;
use POSIX qw(strftime);
use IPC::Run;
use Nix::Store;
use Hydra::Helper::Nix;
use Digest::SHA qw(sha256_hex);
use File::Basename;

View File

@ -3,6 +3,7 @@ package Hydra::Helper::CatalystUtils;
use strict;
use Exporter;
use Readonly;
use Nix::Store;
use Hydra::Helper::Nix;
our @ISA = qw(Exporter);
@ -117,8 +118,8 @@ sub getChannelData {
my @storePaths = ();
foreach my $build (@builds2) {
next unless Hydra::Helper::Nix::isValidPath($build->outpath);
if (Hydra::Helper::Nix::isValidPath($build->drvpath)) {
next unless isValidPath($build->outpath);
if (isValidPath($build->drvpath)) {
# Adding `drvpath' implies adding `outpath' because of the
# `--include-outputs' flag passed to `nix-store'.
push @storePaths, $build->drvpath;

View File

@ -4,12 +4,10 @@ use strict;
use Exporter;
use File::Path;
use File::Basename;
use Nix;
use Hydra::Helper::CatalystUtils;
our @ISA = qw(Exporter);
our @EXPORT = qw(
isValidPath
getHydraPath getHydraDBPath openHydraDB getHydraConf txn_do
registerRoot getGCRootsDir gcRootFor
getPrimaryBuildsForView
@ -17,12 +15,6 @@ our @EXPORT = qw(
getViewResult getLatestSuccessfulViewResult jobsetOverview removeAsciiEscapes);
sub isValidPath {
my $path = shift;
return Nix::isValidPath($path);
}
sub getHydraPath {
my $dir = $ENV{"HYDRA_DATA"} || "/var/lib/hydra";
die "The HYDRA_DATA directory ($dir) does not exist!\n" unless -d $dir;