[pbs-devel] [PATCH proxmox-backup 1/2] pbs3to4: add check for spelling of pbs-test repo

Fiona Ebner f.ebner at proxmox.com
Wed Aug 6 12:07:02 CEST 2025


Logic copied and messages adapted from the pve8to9 checker script in
Proxmox VE.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/bin/pbs3to4.rs | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/src/bin/pbs3to4.rs b/src/bin/pbs3to4.rs
index 67640b48..46aa0a63 100644
--- a/src/bin/pbs3to4.rs
+++ b/src/bin/pbs3to4.rs
@@ -252,6 +252,7 @@ impl Checker {
         let mut strange_suite = false;
         let mut mismatches = Vec::new();
         let mut found_suite: Option<(String, String)> = None;
+        let mut test_repos = Vec::new();
 
         let (repo_files, _repo_errors, _digest) = repositories::repositories()?;
         for repo_file in repo_files {
@@ -259,6 +260,7 @@ impl Checker {
                 &mut found_suite,
                 &mut mismatches,
                 &mut strange_suite,
+                &mut test_repos,
                 repo_file,
             )?;
         }
@@ -283,6 +285,41 @@ impl Checker {
             }
         }
 
+        // TODO remove the check in PBS 5, one cannot really update to latest 4.4 with an old test
+        // repo anyway
+        for (component, suite, location) in &test_repos {
+            self.output.log_info(format!(
+                "Found test repo for Proxmox Backup Server at {location}, checking compatibility \
+                    with updated 'pve-test' spelling.",
+            ))?;
+            match component.as_str() {
+                "pbstest" => {
+                    let message = format!(
+                        "Found legacy spelling 'pbstest' of the pbs-test repo. Change the repo to \
+                            use 'pbs-test' when updating the repos to the '{NEW_SUITE}' suite for \
+                            Proxmox Backup Server 4!"
+                    );
+                    match suite.as_str() {
+                        NEW_SUITE => self.output.log_fail(message)?,
+                        OLD_SUITE => self.output.log_warn(message)?,
+                        _ => {} // unreachable, other suites return early in check_repo_file()
+                    }
+                }
+                "pbs-test" => match suite.as_str() {
+                    NEW_SUITE => self.output.log_pass(format!(
+                        "Found modern spelling 'pbs-test' of the pbs-test repo for new suite \
+                            '{NEW_SUITE}'.",
+                    ))?,
+                    OLD_SUITE => self.output.log_fail(format!(
+                        "Found modern spelling 'pbs-test' but old suite '{OLD_SUITE}', did you \
+                            forget to update the suite?",
+                    ))?,
+                    _ => {} // unreachable, other suites return early in check_repo_file()
+                },
+                _ => {} // unreachable, only test repositories are added
+            }
+        }
+
         Ok(())
     }
 
@@ -331,6 +368,7 @@ impl Checker {
         found_suite: &mut Option<(String, String)>,
         mismatches: &mut Vec<(String, String)>,
         strange_suite: &mut bool,
+        test_repos: &mut Vec<(String, String, String)>,
         repo_file: APTRepositoryFile,
     ) -> Result<(), Error> {
         for repo in repo_file.repositories {
@@ -368,6 +406,13 @@ impl Checker {
                     let location = repo_file.path.clone().unwrap_or_default();
                     *found_suite = Some((suite.to_string(), location));
                 }
+
+                for component in &repo.components {
+                    if component == "pbstest" || component == "pbs-test" {
+                        let location = repo_file.path.clone().unwrap_or_default();
+                        test_repos.push((component.to_string(), suite.to_string(), location));
+                    }
+                }
             }
         }
         Ok(())
-- 
2.47.2





More information about the pbs-devel mailing list