[pbs-devel] [PATCH proxmox-backup v2 2/3] pbs3to4: use boolean variable for systemd-boot installation state
Stoiko Ivanov
s.ivanov at proxmox.com
Thu Aug 21 16:17:18 CEST 2025
while it's not saving too much run-time wise (each branch stats the
file only once), it's a bit easier to read.
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
src/bin/pbs3to4.rs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/bin/pbs3to4.rs b/src/bin/pbs3to4.rs
index 5df960a3..3c3a020f 100644
--- a/src/bin/pbs3to4.rs
+++ b/src/bin/pbs3to4.rs
@@ -206,8 +206,11 @@ impl Checker {
self.output
.log_info("Checking bootloader configuration...")?;
+ let sd_boot_installed =
+ Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file();
+
if !Path::new("/sys/firmware/efi").is_dir() {
- if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
+ if sd_boot_installed {
self.output.log_info(
"systemd-boot package installed on legacy-boot system is not \
necessary, consider removing it",
@@ -227,7 +230,7 @@ impl Checker {
.log_skip("not yet upgraded, systemd-boot still needed for bootctl")?;
return Ok(());
}
- if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
+ if sd_boot_installed {
self.output.log_fail(
"systemd-boot meta-package installed. This will cause issues on upgrades of \
boot-related packages.\n\
@@ -237,7 +240,7 @@ impl Checker {
return Ok(());
}
} else {
- if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
+ if sd_boot_installed {
self.output.log_fail(
"systemd-boot meta-package installed. This will cause problems on upgrades of other \
boot-related packages.\n\
--
2.39.5
More information about the pbs-devel
mailing list