From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 92FED1FF17C for ; Wed, 6 Aug 2025 12:08:16 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0EF5938681; Wed, 6 Aug 2025 12:09:48 +0200 (CEST) From: Fiona Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 6 Aug 2025 12:07:02 +0200 Message-ID: <20250806100941.59272-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250806100941.59272-1-f.ebner@proxmox.com> References: <20250806100941.59272-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754474963502 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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. [pbs3to4.rs] Subject: [pbs-devel] [PATCH proxmox-backup 1/2] pbs3to4: add check for spelling of pbs-test repo X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Logic copied and messages adapted from the pve8to9 checker script in Proxmox VE. Signed-off-by: Fiona Ebner --- 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