Commit 5be32a77 authored by Dietmar Maurer's avatar Dietmar Maurer

add changelog url to package info

parent 945ad565
...@@ -70,11 +70,29 @@ __PACKAGE__->register_method({ ...@@ -70,11 +70,29 @@ __PACKAGE__->register_method({
my $assemble_pkginfo = sub { my $assemble_pkginfo = sub {
my ($pkgname, $info, $current_ver, $candidate_ver) = @_; my ($pkgname, $info, $current_ver, $candidate_ver) = @_;
my $changelog_url;
foreach my $verfile (@{$candidate_ver->{FileList}}) {
my $pkgfile = $verfile->{File};
my $origin = $pkgfile->{Origin};
my $comp = $pkgfile->{Component};
if ($origin && $comp) {
my $pkgver = $candidate_ver->{VerStr};
my $firstLetter = substr($pkgname, 0, 1);
if ($origin eq 'Debian') {
$changelog_url = "http://packages.debian.org/changelogs/pool/main/" .
"$firstLetter/$pkgname/${pkgname}_$pkgver/changelog";
}
last;
}
}
my $data = { my $data = {
Package => $info->{Name}, Package => $info->{Name},
Title => $info->{ShortDesc}, Title => $info->{ShortDesc},
}; };
$data->{ChangeLogUrl} = $changelog_url if $changelog_url;
if (my $desc = $info->{LongDesc}) { if (my $desc = $info->{LongDesc}) {
$desc =~ s/^.*\n\s?//; # remove first line $desc =~ s/^.*\n\s?//; # remove first line
$desc =~ s/\n / /g; $desc =~ s/\n / /g;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment