Debs, tars, …).
NUIKDEHLDR4ANFZFRCWBAWZGFVMHCZ7PSMPPFVQJ3AAAAWAQQD4AC
D3DIBMOKXK2E65267BEEWQL4S4NSHGZBCY7YTU34JSEPZ7AKNBRQC
HPIJ35SGWBE4WZE5RGSYGR7IRPCFYROUUUAHAC7E5TDCMSVM2OZAC
UQ6K57MSDZQLOKQAMFBH6K4CIROQ54ZEQZ3KVZ22YCLDCJ6FRYRAC
T4LLYESZ2HUXSLKZ6GNBLVWUVG7R5IDFHYHYO773QIZ6QTOOXR2AC
P6K2FSSS4QLESNPA3GYYJUA4LUAOXXJZVBUFRMZPQHCD2HA4HJNAC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
5NO7NCKTMM5ZW7JYOETUFOSWK2ACTXWDZGJAFXZN6L3OF6BFTNOQC
SMM4HQTPAY45254O7GQOJVLHP5LZ6BXDKGNE7IKUJHB5XKH244ZAC
JFZNAYJXKCMXYHGCLTRH7Q6TOFGJ4BT6332GONCWVYRLNMDDG3KAC
Y35C6GHH45ZUEZHHYZU4BQK3GOPJENOY2DZM3TMVUA6AMSPT2I7AC
}
sub contents : Chained('build') PathPart {
my ($self, $c, $productnr, @path) = @_;
my $product = $c->stash->{build}->buildproducts->find({productnr => $productnr});
notFound($c, "Build doesn't have a product $productnr.") if !defined $product;
my $path = $product->path;
notFound($c, "Product $path has disappeared.") unless -e $path;
my $res;
if ($product->type eq "nix-build") {
$res = `cd $path && find . -print0 | xargs -0 ls -ld --`;
error($c, "`ls -lR' error: $?") if $? != 0;
}
elsif ($path =~ /\.rpm$/) {
$res = `rpm --query --info --package "$path"`;
error($c, "RPM error: $?") if $? != 0;
$res .= "===\n";
$res .= `rpm --query --list --verbose --package "$path"`;
error($c, "RPM error: $?") if $? != 0;
}
elsif ($path =~ /\.deb$/) {
$res = `dpkg-deb --info "$path"`;
error($c, "`dpkg-deb' error: $?") if $? != 0;
$res .= "===\n";
$res .= `dpkg-deb --contents "$path"`;
error($c, "`dpkg-deb' error: $?") if $? != 0;
}
elsif ($path =~ /\.tar(\.gz|\.bz2|\.lzma)?$/ ) {
$res = `tar tvfa "$path"`;
error($c, "`tar' error: $?") if $? != 0;
}
elsif ($path =~ /\.zip$/ ) {
$res = `unzip -v "$path"`;
error($c, "`unzip' error: $?") if $? != 0;
}
else {
error($c, "Unsupported file type.");
}
die unless $res;
$c->stash->{'plain'} = { data => $res };
$c->forward('Hydra::View::Plain');