From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Shannon Sterz <s.sterz@proxmox.com>
Subject: Re: [pve-devel] [PATCH proxmox-offline-mirror 5/8] wizard: simplify Proxmox repository url generation
Date: Tue, 09 Sep 2025 10:35:09 +0200 [thread overview]
Message-ID: <1757406290.ylftb1spdy.astroid@yuna.none> (raw)
In-Reply-To: <DCNIQTXLT5Z5.2TZ0P7NK06F6T@proxmox.com>
On September 8, 2025 5:20 pm, Shannon Sterz wrote:
> On Mon Sep 8, 2025 at 3:16 PM CEST, Fabian Grünbichler wrote:
>> except for test since Trixie, all repositories follow the same scheme..
>>
>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>> ---
>> src/bin/proxmox-offline-mirror.rs | 51 +++++++++----------------------
>> 1 file changed, 15 insertions(+), 36 deletions(-)
>>
>> diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
>> index 8198cff..c444e6d 100644
>> --- a/src/bin/proxmox-offline-mirror.rs
>> +++ b/src/bin/proxmox-offline-mirror.rs
>> @@ -356,44 +356,23 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
>> read_selection_from_tty("Select repository variant", variants, Some(0))?;
>>
>> // TODO enterprise query for key!
>> - let url = match (release, variant) {
>> - (Release::Trixie, ProxmoxVariant::Enterprise) => format!(
>> - "https://enterprise.proxmox.com/debian/{product} trixie {product}-enterprise"
>> + let url = match variant {
>> + ProxmoxVariant::Enterprise => format!(
>> + "https://enterprise.proxmox.com/debian/{product} {release} {product}-enterprise"
>> ),
>> - (Release::Trixie, ProxmoxVariant::NoSubscription) => format!(
>> - "http://download.proxmox.com/debian/{product} trixie {product}-no-subscription"
>> + ProxmoxVariant::NoSubscription => format!(
>> + "http://download.proxmox.com/debian/{product} {release} {product}-no-subscription"
>> ),
>> - (Release::Trixie, ProxmoxVariant::Test) => {
>> - format!(
>> - "http://download.proxmox.com/debian/{product} trixie {product}-test"
>> - )
>> - }
>> - (Release::Bookworm, ProxmoxVariant::Enterprise) => format!(
>> - "https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise"
>> - ),
>> - (Release::Bookworm, ProxmoxVariant::NoSubscription) => format!(
>> - "http://download.proxmox.com/debian/{product} bookworm {product}-no-subscription"
>> - ),
>> - (Release::Bookworm, ProxmoxVariant::Test) => format!(
>> - "http://download.proxmox.com/debian/{product} bookworm {product}test"
>> - ),
>> - (Release::Bullseye, ProxmoxVariant::Enterprise) => format!(
>> - "https://enterprise.proxmox.com/debian/{product} bullseye {product}-enterprise"
>> - ),
>> - (Release::Bullseye, ProxmoxVariant::NoSubscription) => format!(
>> - "http://download.proxmox.com/debian/{product} bullseye {product}-no-subscription"
>> - ),
>> - (Release::Bullseye, ProxmoxVariant::Test) => format!(
>> - "http://download.proxmox.com/debian/{product} bullseye {product}test"
>> - ),
>> - (Release::Buster, ProxmoxVariant::Enterprise) => format!(
>> - "https://enterprise.proxmox.com/debian/{product} buster {product}-enterprise"
>> - ),
>> - (Release::Buster, ProxmoxVariant::NoSubscription) => format!(
>> - "http://download.proxmox.com/debian/{product} buster {product}-no-subscription"
>> - ),
>> - (Release::Buster, ProxmoxVariant::Test) => {
>> - format!("http://download.proxmox.com/debian/{product} buster {product}test")
>> + ProxmoxVariant::Test => {
>> + if release >= &Release::Trixie {
>> + format!(
>> + "http://download.proxmox.com/debian/{product} {release} {product}-test"
>> + )
>> + } else {
>> + format!(
>> + "http://download.proxmox.com/debian/{product} {release} {product}test"
>> + )
>> + }
>> }
>> };
>>
>
> is there a reason why the `Display` implementation for
> `ProxmoxVariant::NoSubscription` uses an underscore? from what i can
> tell we mostly seem to use it to derive a suggested mirro id. if we used
> a hyphen there instead this could become
>
> if release < &Release::Trixie && variant == ProxmoxVariant::Test {
> format!(
> "http://download.proxmox.com/debian/{product} {release} {product}test"
> )
> } else {
> format!(
> "http://download.proxmox.com/debian/{product} {release} {product}-{variant}"
> )
> }
I guess this would work - but it still needs to account for enterprise
having a different base url ;) I'll send a follow-up patch for this if
it looks sane
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-09 8:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 13:16 [pve-devel] [PATCH proxmox-offline-mirror 0/8] misc. wizard cleanup Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 1/8] wizard: simplify repository url generation Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 2/8] wizard: implement PartialOrd/Ord on Release Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 3/8] wizard: switch to .pgp for Debian keyring files Fabian Grünbichler
2025-09-08 13:53 ` Shannon Sterz
2025-09-09 8:24 ` Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 4/8] wizard: use /usr/share/keyring/proxmox-release-bookworm.gpg Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 5/8] wizard: simplify Proxmox repository url generation Fabian Grünbichler
2025-09-08 15:20 ` Shannon Sterz
2025-09-09 8:35 ` Fabian Grünbichler [this message]
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 6/8] wizard: drop Release::Buster and Ceph::Luminous/Nautilus Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 7/8] wizard: simplify default Debian components Fabian Grünbichler
2025-09-08 13:16 ` [pve-devel] [PATCH proxmox-offline-mirror 8/8] wizard: deduplicate Proxmox key path mapping Fabian Grünbichler
2025-09-08 15:27 ` [pve-devel] [PATCH proxmox-offline-mirror 0/8] misc. wizard cleanup Shannon Sterz
2025-09-09 9:02 ` [pve-devel] applied-series: " Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1757406290.ylftb1spdy.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=s.sterz@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.