public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH 1/2] add bookworm to the list of releases
Date: Fri,  9 Jun 2023 12:50:35 +0200	[thread overview]
Message-ID: <20230609105036.381912-2-s.sterz@proxmox.com> (raw)
In-Reply-To: <20230609105036.381912-1-s.sterz@proxmox.com>

add support for bookworm based proxmox products and debian
repositories/
---
 src/bin/proxmox-offline-mirror.rs | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
index 8398db4..9dfde91 100644
--- a/src/bin/proxmox-offline-mirror.rs
+++ b/src/bin/proxmox-offline-mirror.rs
@@ -44,6 +44,7 @@ impl Display for Distro {
 }
 
 enum Release {
+    Bookworm,
     Bullseye,
     Buster,
 }
@@ -51,6 +52,7 @@ enum Release {
 impl Display for Release {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {
+            Release::Bookworm => write!(f, "bookworm"),
             Release::Bullseye => write!(f, "bullseye"),
             Release::Buster => write!(f, "buster"),
         }
@@ -131,6 +133,19 @@ fn derive_debian_repo(
         skip_sections,
     };
     let url = match (release, variant) {
+        (Release::Bookworm, DebianVariant::Main) => "http://deb.debian.org/debian bookworm",
+        (Release::Bookworm, DebianVariant::Security) => {
+            "http://deb.debian.org/debian-security bookworm-security"
+        }
+        (Release::Bookworm, DebianVariant::Updates) => {
+            "http://deb.debian.org/debian bookworm-updates"
+        }
+        (Release::Bookworm, DebianVariant::Backports) => {
+            "http://deb.debian.org/debian bookworm-backports"
+        }
+        (Release::Bookworm, DebianVariant::Debug) => {
+            "http://deb.debian.org/debian-debug bookworm-debug"
+        }
         (Release::Bullseye, DebianVariant::Main) => "http://deb.debian.org/debian bullseye",
         (Release::Bullseye, DebianVariant::Security) => {
             "http://deb.debian.org/debian-security bullseye-security"
@@ -159,6 +174,10 @@ fn derive_debian_repo(
 
     let url = format!("{url} {components}");
     let key = match (release, variant) {
+        (Release::Bookworm, DebianVariant::Security) => {
+            "/usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg"
+        }
+        (Release::Bookworm, _) => "/usr/share/keyrings/debian-archive-bookworm-automatic.gpg",
         (Release::Bullseye, DebianVariant::Security) => {
             "/usr/share/keyrings/debian-archive-bullseye-security-automatic.gpg"
         }
@@ -191,7 +210,11 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
         ];
         let dist = read_selection_from_tty("Select distro to mirror", distros, None)?;
 
-        let releases = &[(Release::Bullseye, "Bullseye"), (Release::Buster, "Buster")];
+        let releases = &[
+            (Release::Bookworm, "Bookworm"),
+            (Release::Bullseye, "Bullseye"),
+            (Release::Buster, "Buster"),
+        ];
         let release = read_selection_from_tty("Select release", releases, Some(0))?;
 
         let mut add_debian_repo = false;
@@ -224,6 +247,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                 }
 
                 let releases = match release {
+                    &Release::Bookworm => vec![(CephRelease::Quincy, "Quincy (17.x)")],
                     Release::Bullseye => {
                         vec![
                             (CephRelease::Octopus, "Octopus (15.x)"),
@@ -250,6 +274,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     read_string_from_tty("Enter repository components", Some("main test"))?;
 
                 let key = match release {
+                    Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg",
                     Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg",
                     Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg",
                 };
@@ -281,6 +306,9 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
 
                 // TODO enterprise query for key!
                 let url = match (release, variant) {
+                    (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"),
@@ -297,6 +325,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                 };
 
                 let key = match release {
+                    Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg",
                     Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg",
                     Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg",
                 };
-- 
2.30.2





  reply	other threads:[~2023-06-09 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 10:50 [pbs-devel] [PATCH 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
2023-06-09 10:50 ` Stefan Sterz [this message]
2023-06-09 10:50 ` [pbs-devel] [PATCH 2/2] add support for bookworm enterprise ceph repo Stefan Sterz
2023-06-25 15:01 ` [pbs-devel] applied-series: [PATCH 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht

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=20230609105036.381912-2-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=pbs-devel@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal