[pdm-devel] [PATCH proxmox-backup v3 2/2] notifications/pbsXtoX: adapt to proxmox-apt making old_version optional

Shannon Sterz s.sterz at proxmox.com
Fri Nov 21 17:06:35 CET 2025


this patch wasn't meant for this series not sure what happened here,
sorry.

On Wed Nov 19, 2025 at 3:06 PM CET, Shannon Sterz wrote:
> Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
> Tested-by: Lukas Wagner <l.wagner at proxmox.com>
> Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>
> ---
>  src/bin/pbs2to3.rs                             | 4 ++--
>  src/bin/pbs3to4.rs                             | 4 ++--
>  src/server/notifications/template_data.rs      | 2 +-
>  templates/default/package-updates-body.txt.hbs | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs
> index f5a3cce6..6f9ad9d1 100644
> --- a/src/bin/pbs2to3.rs
> +++ b/src/bin/pbs2to3.rs
> @@ -88,9 +88,9 @@ impl Checker {
>              .iter()
>              .find(|pkg| pkg.package.as_str() == PROXMOX_BACKUP_META);
>
> -        if let Some(pbs_meta_pkg) = pbs_meta_pkg {
> +        if let Some(old_version) = pbs_meta_pkg.and_then(|m| m.old_version.as_ref()) {
>              let pkg_version = Regex::new(r"^(\d+)\.(\d+)[.-](\d+)")?;
> -            let captures = pkg_version.captures(&pbs_meta_pkg.old_version);
> +            let captures = pkg_version.captures(old_version);
>              if let Some(captures) = captures {
>                  let maj = Self::extract_version_from_captures(1, &captures)?;
>                  let min = Self::extract_version_from_captures(2, &captures)?;
> diff --git a/src/bin/pbs3to4.rs b/src/bin/pbs3to4.rs
> index 1d99a592..8f0bfc0d 100644
> --- a/src/bin/pbs3to4.rs
> +++ b/src/bin/pbs3to4.rs
> @@ -89,9 +89,9 @@ impl Checker {
>              .iter()
>              .find(|pkg| pkg.package.as_str() == PROXMOX_BACKUP_META);
>
> -        if let Some(pbs_meta_pkg) = pbs_meta_pkg {
> +        if let Some(old_version) = pbs_meta_pkg.and_then(|m| m.old_version.as_ref()) {
>              let pkg_version = Regex::new(r"^(\d+)\.(\d+)[.-](\d+)")?;
> -            let captures = pkg_version.captures(&pbs_meta_pkg.old_version);
> +            let captures = pkg_version.captures(old_version);
>              if let Some(captures) = captures {
>                  let maj = Self::extract_version_from_captures(1, &captures)?;
>                  let min = Self::extract_version_from_captures(2, &captures)?;
> diff --git a/src/server/notifications/template_data.rs b/src/server/notifications/template_data.rs
> index 0dcc5ed3..88e49a03 100644
> --- a/src/server/notifications/template_data.rs
> +++ b/src/server/notifications/template_data.rs
> @@ -154,7 +154,7 @@ pub struct UpgradablePackage {
>      /// The new version which can be installed.
>      available_version: String,
>      /// The currently installed version.
> -    installed_version: String,
> +    installed_version: Option<String>,
>  }
>
>  /// Template data for the package-updates template.
> diff --git a/templates/default/package-updates-body.txt.hbs b/templates/default/package-updates-body.txt.hbs
> index 9800ab5c..61f5eec3 100644
> --- a/templates/default/package-updates-body.txt.hbs
> +++ b/templates/default/package-updates-body.txt.hbs
> @@ -1,6 +1,6 @@
>  Proxmox Backup Server has the following updates available:
>  {{#each available-updates}}
> -    {{this.package-name}}: {{this.installed-version}} -> {{this.available-version}}
> +    {{this.package-name}}: {{#if this.installed-version}}{{this.installed-version}} ->{{else}}NEW,{{/if}} {{this.available-version}}
>  {{/each}}
>
>  To upgrade visit the web interface:
> --
> 2.47.3





More information about the pdm-devel mailing list