We only allow channel/latest anyway, so it really doesn't make sense to explicitly specify this in the PathPart and provide other dispatcher once we have more than just "latest", which greatly simplifies the dispatch tree.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
IZ7MTJNRORVGVHG6R4N3NGXPR5O5DQ3ICCZ2XFD74ACFUEDOVG6QC
FG4JZPWS76SM2UQ7CJWO54S7SXRWPZPK4ZBIGLOVHWSJTOSCZFOQC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
AKAZKCR6GFCZQBR2ZJSZEI3SXW4S25V7X7JGHUYNUITQQSAVAF5AC
HXBXDEFK2VLXZIWUXAQ765NHKYQ5FYS43IKMU2DJ755L26TQ6IFQC
LKPVSUCI2AE5OMB7R3KIHWZNBAWNAPMN7VRPQ6ZYDGMF2W54SZIAC
PMNWRTGJ4GVSMSSAWSUD57B26PCRAHMZIQ5SIWJIK7A74ENKEQLAC
SJN2QPWHFYKX7CJMW4XZHI2P2THH7MECZZIHQMCH6EKBZ45G3DOAC
7G5RWHB7MRELVG2X5VXQE2T2JROZQNUQPTUIIVOHUQIIXBZIDZOAC
BDY5KCG7Z65C24KALK5QIGR6LRTDY6EW36VBTTYT75SMG6ODIJZAC
BTUDUY6FY6UTRZOGLSPFNA4MVTSP7JXBD44VYF6BPKNFF6Y3CY2QC
eval {
if ($channelName eq "latest") {
$c->stash->{channelName} = $c->stash->{channelBaseName} . "-latest";
$c->stash->{channelBuilds} = $c->stash->{latestSucceeded}
->search_literal("exists (select 1 from buildproducts where build = me.id and type = 'nix-build')")
->search({}, { columns => [@buildListColumns, 'drvpath', 'description', 'homepage']
, join => ["buildoutputs"]
, order_by => ["me.id", "buildoutputs.name"]
, '+select' => ['buildoutputs.path', 'buildoutputs.name'], '+as' => ['outpath', 'outname'] });
}
else {
notFound($c, "Unknown channel `$channelName'.");
}
};
error($c, $@) if $@;
$c->stash->{channelName} = $c->stash->{channelBaseName} . "-latest";
$c->stash->{channelBuilds} = $c->stash->{latestSucceeded}
->search_literal("exists (select 1 from buildproducts where build = me.id and type = 'nix-build')")
->search({}, { columns => [@buildListColumns, 'drvpath', 'description', 'homepage']
, join => ["buildoutputs"]
, order_by => ["me.id", "buildoutputs.name"]
, '+select' => ['buildoutputs.path', 'buildoutputs.name'], '+as' => ['outpath', 'outname'] });