FG4JZPWS76SM2UQ7CJWO54S7SXRWPZPK4ZBIGLOVHWSJTOSCZFOQC
LKPVSUCI2AE5OMB7R3KIHWZNBAWNAPMN7VRPQ6ZYDGMF2W54SZIAC
6KIJX24R5RRDR2UQMUAWHF3N6V6DKKL5URYSLB7IT4J5C3RO4G2AC
L5Z6CN7MHFGRL2QPLCVQJSDECT35EW52INUV5RVI4CXH2YSDJGNAC
PMNWRTGJ4GVSMSSAWSUD57B26PCRAHMZIQ5SIWJIK7A74ENKEQLAC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
HXBXDEFK2VLXZIWUXAQ765NHKYQ5FYS43IKMU2DJ755L26TQ6IFQC
5NO7NCKTMM5ZW7JYOETUFOSWK2ACTXWDZGJAFXZN6L3OF6BFTNOQC
U4TD3AIQXBJFFUORTMIC4IHZTVBORRKL2TZ2FSP4G665ECZOEMNAC
LVJKRTIK5WOWWAZ454B4DCCGETOIQJK5TLOWMZVNY2B4AEGF2GMAC
I42G2Z7PKDALZKM526VU253MZORF54KFJ3VNGXVE76LRH2RGNORQC
BHZXGT2HWAMFNVBUDG7VR5HNA2SUJBUSMWB7EHTECB4QJ5HVYANAC
foreach my $build ($c->stash->{channelBuilds}->all) {
my $outPath = $build->get_column("outpath");
my $outName = $build->get_column("outname");
next if $checkValidity && !isValidPath($outPath);
push @storePaths, $outPath;
my $pkgName = $build->nixname . "-" . $build->system . "-" . $build->id . ($outName ne "out" ? "-" . $outName : "");
push @{$c->stash->{nixPkgs}}, { build => $build, name => $pkgName, outPath => $outPath, outName => $outName };
# Put the system type in the manifest (for top-level paths) as
# a hint to the binary patch generator. (It shouldn't try to
# generate patches between builds for different systems.) It
# would be nice if Nix stored this info for every path but it
# doesn't.
$c->stash->{systemForPath}->{$outPath} = $build->system;
};
my @builds = $c->stash->{channelBuilds}->all;
for (my $n = 0; $n < scalar @builds; ) {
# Since channelData is a join of Builds and BuildOutputs, we
# need to gather the rows that belong to a single build.
my $build = $builds[$n++];
my @outputs = ($build);
push @outputs, $builds[$n++] while $n < scalar @builds && $builds[$n]->id == $build->id;
@outputs = grep { $_->get_column("outpath") } @outputs;
my $outputs = {};
foreach my $output (@outputs) {
my $outPath = $output->get_column("outpath");
next if $checkValidity && !isValidPath($outPath);
$outputs->{$output->get_column("outname")} = $outPath;
push @storePaths, $outPath;
# Put the system type in the manifest (for top-level
# paths) as a hint to the binary patch generator. (It
# shouldn't try to generate patches between builds for
# different systems.) It would be nice if Nix stored this
# info for every path but it doesn't.
$c->stash->{systemForPath}->{$outPath} = $build->system;
}
my $s = "";
$s .= " # $pkg->{name}\n";
$s .= " ${\escape $build->get_column('job')} = {\n";
$s .= " type = \"derivation\";\n";
$s .= " name = ${\escape ($build->get_column('releasename') or $build->nixname)};\n";
$s .= " system = ${\escape $build->system};\n";
$s .= " outPath = ${\escape $pkg->{outPath}};\n";
$s .= " meta = {\n";
$s .= " description = ${\escape $build->description};\n"
if $build->description;
$s .= " longDescription = ${\escape $build->longdescription};\n"
if $build->longdescription;
$s .= " license = ${\escape $build->license};\n"
if $build->license;
$s .= " maintainers = ${\escape $build->maintainers};\n"
if $build->maintainers;
$s .= " };\n";
$s .= " };\n\n";
$perSystem{$build->system} .= $s;
$perSystem{$build->system}->{$build->get_column('job')} = $pkg;
my $res = "{ system ? builtins.currentSystem }:\n\n";
my $res = <<EOF;
{ system ? builtins.currentSystem }:
let
mkFakeDerivation = attrs: outputs:
let
outputNames = builtins.attrNames outputs;
common = attrs // outputsSet //
{ type = "derivation";
outputs = outputNames;
all = outputsList;
};
outputToAttrListElement = outputName:
{ name = outputName;
value = common // {
inherit outputName;
outPath = builtins.getAttr outputName outputs;
};
};
outputsList = map outputToAttrListElement outputNames;
outputsSet = builtins.listToAttrs outputsList;
in outputsSet;
in
$res .= $perSystem{$system};
foreach my $job (keys $perSystem{$system}) {
my $pkg = $perSystem{$system}->{$job};
my $build = $pkg->{build};
$res .= " # Hydra build ${\$build->id}\n";
my $attr = $build->get_column('job');
$attr =~ s/\./-/g;
$res .= " ${\escape $attr} = (mkFakeDerivation {\n";
$res .= " type = \"derivation\";\n";
$res .= " name = ${\escape ($build->get_column('releasename') or $build->nixname)};\n";
$res .= " system = ${\escape $build->system};\n";
$res .= " meta = {\n";
$res .= " description = ${\escape $build->description};\n"
if $build->description;
$res .= " longDescription = ${\escape $build->longdescription};\n"
if $build->longdescription;
$res .= " license = ${\escape $build->license};\n"
if $build->license;
$res .= " maintainers = ${\escape $build->maintainers};\n"
if $build->maintainers;
$res .= " };\n";
$res .= " } {\n";
my @outputNames = sort (keys $pkg->{outputs});
$res .= " ${\escape $_} = ${\escape $pkg->{outputs}->{$_}};\n" foreach @outputNames;
my $out = defined $pkg->{outputs}->{"out"} ? "out" : $outputNames[0];
$res .= " }).$out;\n\n";
}