* [pbs-devel] [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo
@ 2025-08-06 10:07 Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 1/2] " Fiona Ebner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Fiona Ebner @ 2025-08-06 10:07 UTC (permalink / raw)
To: pbs-devel
Fiona Ebner (2):
pbs3to4: add check for spelling of pbs-test repo
pbs3to4: clippy: allow always true comparision against minimal value
src/bin/pbs3to4.rs | 48 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 1/2] pbs3to4: add check for spelling of pbs-test repo
2025-08-06 10:07 [pbs-devel] [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Fiona Ebner
@ 2025-08-06 10:07 ` Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs3to4: clippy: allow always true comparision against minimal value Fiona Ebner
2025-08-06 11:22 ` [pbs-devel] applied-series: [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2025-08-06 10:07 UTC (permalink / raw)
To: pbs-devel
Logic copied and messages adapted from the pve8to9 checker script in
Proxmox VE.
Signed-off-by: Fiona Ebner <f.ebner@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
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 2/2] pbs3to4: clippy: allow always true comparision against minimal value
2025-08-06 10:07 [pbs-devel] [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 1/2] " Fiona Ebner
@ 2025-08-06 10:07 ` Fiona Ebner
2025-08-06 11:22 ` [pbs-devel] applied-series: [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2025-08-06 10:07 UTC (permalink / raw)
To: pbs-devel
MIN_PBS_PKGREL is a constant that is zero, so the check is currently
superfluous, but that might not always be the case.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/bin/pbs3to4.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bin/pbs3to4.rs b/src/bin/pbs3to4.rs
index 46aa0a63..a60c77e2 100644
--- a/src/bin/pbs3to4.rs
+++ b/src/bin/pbs3to4.rs
@@ -98,6 +98,9 @@ impl Checker {
let min_version = format!("{MIN_PBS_MAJOR}.{MIN_PBS_MINOR}.{MIN_PBS_PKGREL}");
+ // MIN_PBS_PKGREL is currently zero, making the comparison further below
+ // superfluous, but this might not always be the case
+ #[allow(clippy::absurd_extreme_comparisons)]
if maj > MIN_PBS_MAJOR {
self.output
.log_pass(format!("Already upgraded to Proxmox Backup Server {maj}"))?;
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] applied-series: [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo
2025-08-06 10:07 [pbs-devel] [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 1/2] " Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs3to4: clippy: allow always true comparision against minimal value Fiona Ebner
@ 2025-08-06 11:22 ` Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-08-06 11:22 UTC (permalink / raw)
To: pbs-devel, Fiona Ebner
On Wed, 06 Aug 2025 12:07:01 +0200, Fiona Ebner wrote:
> Fiona Ebner (2):
> pbs3to4: add check for spelling of pbs-test repo
> pbs3to4: clippy: allow always true comparision against minimal value
>
> src/bin/pbs3to4.rs | 48 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> [...]
Applied, thanks!
[1/2] pbs3to4: add check for spelling of pbs-test repo
commit: cf9334627cf0223eabe3fe6ef6991388a7826704
[2/2] pbs3to4: clippy: allow always true comparision against minimal value
commit: c6d5c11639e4a7b6556e80966cdc57ac6e95a4bd
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-06 11:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-06 10:07 [pbs-devel] [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 1/2] " Fiona Ebner
2025-08-06 10:07 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs3to4: clippy: allow always true comparision against minimal value Fiona Ebner
2025-08-06 11:22 ` [pbs-devel] applied-series: [PATCH-SERIES proxmox-backup 0/2] pbs3to4: add check for spelling of pbs-test repo Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox