mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 00:04:14 +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 strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use File::stat ();
|
use File::stat ();
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
|
|
||||||
@ -73,15 +74,14 @@ my $get_changelug_url = sub {
|
|||||||
foreach my $verfile (@{$candidate_ver->{FileList}}) {
|
foreach my $verfile (@{$candidate_ver->{FileList}}) {
|
||||||
my $pkgfile = $verfile->{File};
|
my $pkgfile = $verfile->{File};
|
||||||
my $origin = $pkgfile->{Origin};
|
my $origin = $pkgfile->{Origin};
|
||||||
my $comp = $pkgfile->{Component};
|
my $base = dirname($info->{FileName});
|
||||||
if ($origin && $comp) {
|
if ($origin && $base) {
|
||||||
my $pkgver = $candidate_ver->{VerStr};
|
my $pkgver = $candidate_ver->{VerStr};
|
||||||
$pkgver =~ s/^\d+://; # strip epoch
|
$pkgver =~ s/^\d+://; # strip epoch
|
||||||
my $srcpkg = $info->{SourcePkg} || $pkgname;
|
my $srcpkg = $info->{SourcePkg} || $pkgname;
|
||||||
my $firstLetter = substr($srcpkg, 0, 1);
|
|
||||||
if ($origin eq 'Debian') {
|
if ($origin eq 'Debian') {
|
||||||
$changelog_url = "http://packages.debian.org/changelogs/pool/$comp/" .
|
$changelog_url = "http://packages.debian.org/changelogs/$base/" .
|
||||||
"$firstLetter/$srcpkg/${srcpkg}_$pkgver/changelog";
|
"${srcpkg}_$pkgver/changelog";
|
||||||
}
|
}
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user