public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager] remote_updates/upgrade-checks: fix old-version being optional
Date: Thu, 13 Nov 2025 12:13:44 +0100	[thread overview]
Message-ID: <20251113111344.219791-1-s.sterz@proxmox.com> (raw)

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 lib/proxmox-upgrade-checks/src/lib.rs | 4 ++--
 server/src/remote_updates.rs          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/proxmox-upgrade-checks/src/lib.rs b/lib/proxmox-upgrade-checks/src/lib.rs
index d894f77..c1c0dd9 100644
--- a/lib/proxmox-upgrade-checks/src/lib.rs
+++ b/lib/proxmox-upgrade-checks/src/lib.rs
@@ -202,9 +202,9 @@ impl UpgradeChecker {
             .iter()
             .find(|pkg| pkg.package.as_str() == self.meta_package_name);
 
-        if let Some(meta_pkg) = meta_pkg {
+        if let Some(old_version) = meta_pkg.as_ref().and_then(|m| m.old_version.as_ref()) {
             let pkg_version = Regex::new(r"^(\d+)\.(\d+)[.-](\d+)")?;
-            let captures = pkg_version.captures(&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/server/src/remote_updates.rs b/server/src/remote_updates.rs
index b1db3b8..895381a 100644
--- a/server/src/remote_updates.rs
+++ b/server/src/remote_updates.rs
@@ -287,7 +287,7 @@ fn map_pve_update_info(info: pve_api_types::AptUpdateInfo) -> APTUpdateInfo {
         arch: info.arch.to_string(),
         description: info.description,
         version: info.version,
-        old_version: info.old_version.unwrap_or_default(),
+        old_version: info.old_version,
         origin: info.origin,
         priority: info.priority,
         section: info.section,
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


             reply	other threads:[~2025-11-13 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 11:13 Shannon Sterz [this message]
2025-11-13 12:01 ` [pdm-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251113111344.219791-1-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal