From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 696039722C for ; Sat, 28 Jan 2023 14:56:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7A8B21A809 for ; Sat, 28 Jan 2023 14:56:19 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Sat, 28 Jan 2023 14:56:18 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0E18C469F7 for ; Sat, 28 Jan 2023 14:56:18 +0100 (CET) Message-ID: Date: Sat, 28 Jan 2023 14:56:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:110.0) Gecko/20100101 Thunderbird/110.0 Content-Language: de-AT, en-GB To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= References: <20230118135448.152425-1-l.nunner@proxmox.com> <1674815875.i6y9hjxurd.astroid@yuna.none> From: Thomas Lamprecht In-Reply-To: <1674815875.i6y9hjxurd.astroid@yuna.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.523 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -1.148 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [apt.pm, proxmox.com] Subject: Re: [pve-devel] [PATCH manager] fix 4481: fetch changelogs for any Proxmox repository X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2023 13:56:20 -0000 Am 27/01/2023 um 11:41 schrieb Fabian Gr=C3=BCnbichler: > On January 18, 2023 2:54 pm, Leo Nunner wrote: >> This patch fixes the issue that when the user supplied any non-standar= d >> repositories, the changelogs often wouldn't load. For example, providi= ng >> both pve-no-subscription and pbs-no-subscription broke the changelog >> API, since the URL built for pbs-no-subscription was invalid. >> >> Signed-off-by: Leo Nunner >> --- >> PVE/API2/APT.pm | 13 +++++++++---- >> 1 file changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm >> index 09c76545..921b55a1 100644 >> --- a/PVE/API2/APT.pm >> +++ b/PVE/API2/APT.pm >> @@ -101,10 +101,15 @@ my $get_changelog_url =3Dsub { >> $base =3D~ s!pool/updates/!pool/!; # for security channel >> $changelog_url =3D "http://packages.debian.org/changelogs/$base/= ${srcpkg}_${pkgver}/changelog"; >> } elsif ($origin eq 'Proxmox') { >> - if ($component eq 'pve-enterprise') { >> - $changelog_url =3D "https://enterprise.proxmox.com/debian/$base/${p= kgname}_${pkgver}.changelog"; >> - } else { >> - $changelog_url =3D "http://download.proxmox.com/debian/$base/${pkgn= ame}_${pkgver}.changelog"; >> + my $data =3D Proxmox::RS::APT::Repositories::repositories("pve")= ; >> + >> + for my $file ($data->{files}->@*) { >> + for my $repo ($file->{repositories}->@*) { >> + if (join(" ", $repo->{Components}->@*) eq $component) { >=20 > a few improvements possible here: > - it should be enough that one of the components matches (e.g., I could= have > pvetest and pve-no-subscription configured in a single entry) > - this should only take enabled repositories into account > - we should probably also compare the 'Site' member of $pkgfile toe the= > repository URL >=20 > since $origin and $component also come from $pkgfile at the call sites,= we could > maybe just pass in $pkgfile? >=20 > other than that, this looks okay to me since our components all contain= the > product, so this allows differentiation :) just to be sure: is ceph with it's `test` and `main` covered too?