In Hydra channels, show only packages matching the user's system type

[?]
Oct 7, 2013, 12:53 PM
L5Z6CN7MHFGRL2QPLCVQJSDECT35EW52INUV5RVI4CXH2YSDJGNAC

Dependencies

  • [2] GTGPPGJC Prevent an unnecessary SQL query for every package in the NixExprs view
  • [3] PMNWRTGJ Add multiple output support
  • [4] 5YKSN2MJ * Doh.
  • [5] 32LK6HFV * Escape the outPath in the generated nixexpr.tar.bz2 in channels, because
  • [6] LVJKRTIK * Generate a Nix expression for the channel.
  • [7] PUXLEJTZ * Set mtime to 0 to ensure that the generate tar file doesn't change
  • [8] I42G2Z7P * Escape string literals.[
  • [9] PCK2Q2VO
  • [10] UZENK33P * Generate a .tar.bz2 file for the channel Nix expression, since

Change contents

  • replacement in src/lib/Hydra/View/NixExprs.pm at line 22
    [4.521][4.521:542]()
    my $res = "[\n";
    [4.521]
    [4.542]
    my %perSystem;
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 26
    [3.10956][3.10956:10994](),[3.10994][4.679:727](),[4.679][4.679:727](),[4.727][2.0:103](),[2.103][4.235:302](),[4.235][4.235:302](),[4.302][3.10995:11064](),[4.69][4.970:1004](),[3.11064][4.970:1004](),[4.970][4.970:1004](),[4.1004][4.303:381]()
    $res .= " # $pkg->{name}\n";
    $res .= " { type = \"derivation\";\n";
    $res .= " name = " . escape ($build->get_column("releasename") or $build->nixname) . ";\n";
    $res .= " system = " . (escape $build->system) . ";\n";
    $res .= " outPath = " . (escape $pkg->{outPath}) . ";\n";
    $res .= " meta = {\n";
    $res .= " description = " . (escape $build->description) . ";\n"
    [3.10956]
    [4.1077]
    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"
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 36
    [4.1113][4.382:468]()
    $res .= " longDescription = " . (escape $build->longdescription) . ";\n"
    [4.1113]
    [4.1194]
    $s .= " longDescription = ${\escape $build->longdescription};\n"
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 38
    [4.1234][4.469:539]()
    $res .= " license = " . (escape $build->license) . ";\n"
    [4.1234]
    [4.1299]
    $s .= " license = ${\escape $build->license};\n"
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 40
    [4.1331][4.1331:1384]()
    $res .= " };\n";
    $res .= " }\n";
    [4.1331]
    [4.1384]
    $s .= " maintainers = ${\escape $build->maintainers};\n"
    if $build->maintainers;
    $s .= " };\n";
    $s .= " };\n\n";
    $perSystem{$build->system} .= $s;
    }
    my $res = "{ system ? builtins.currentSystem }:\n\n";
    my $first = 1;
    foreach my $system (keys %perSystem) {
    $res .= "else " if !$first;
    $res .= "if system == ${\escape $system} then {\n\n";
    $res .= $perSystem{$system};
    $res .= "}\n\n";
    $first = 0;
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 58
    [4.1391][4.1391:1410]()
    $res .= "]\n";
    [4.1391]
    [4.124]
    $res .= "else " if !$first;
    $res .= "{}\n";
  • replacement in src/lib/Hydra/View/NixExprs.pm at line 62
    [4.158][4.53:160](),[4.160][4.0:63](),[4.158][4.0:63]()
    $tar->add_data("channel/channel-name", ($c->stash->{channelName} or "unnamed-channel"), {mtime => 0});
    $tar->add_data("channel/default.nix", $res, {mtime => 0});
    [4.158]
    [4.207]
    $tar->add_data("channel/channel-name", ($c->stash->{channelName} or "unnamed-channel"), {mtime => 1});
    $tar->add_data("channel/default.nix", $res, {mtime => 1});