mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-05 09:07:19 +00:00
implement better method to compute changelog url
apt-get uses similar code.
This commit is contained in:
parent
9f6658a9fe
commit
d330e26f99
@ -3,6 +3,7 @@ package PVE::API2::APT;
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::stat ();
|
||||
use File::Basename;
|
||||
|
||||
use LWP::UserAgent;
|
||||
|
||||
@ -73,15 +74,14 @@ my $get_changelug_url = sub {
|
||||
foreach my $verfile (@{$candidate_ver->{FileList}}) {
|
||||
my $pkgfile = $verfile->{File};
|
||||
my $origin = $pkgfile->{Origin};
|
||||
my $comp = $pkgfile->{Component};
|
||||
if ($origin && $comp) {
|
||||
my $base = dirname($info->{FileName});
|
||||
if ($origin && $base) {
|
||||
my $pkgver = $candidate_ver->{VerStr};
|
||||
$pkgver =~ s/^\d+://; # strip epoch
|
||||
my $srcpkg = $info->{SourcePkg} || $pkgname;
|
||||
my $firstLetter = substr($srcpkg, 0, 1);
|
||||
if ($origin eq 'Debian') {
|
||||
$changelog_url = "http://packages.debian.org/changelogs/pool/$comp/" .
|
||||
"$firstLetter/$srcpkg/${srcpkg}_$pkgver/changelog";
|
||||
$changelog_url = "http://packages.debian.org/changelogs/$base/" .
|
||||
"${srcpkg}_$pkgver/changelog";
|
||||
}
|
||||
last;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user