public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array
@ 2024-07-17  7:35 Dietmar Maurer
  2024-07-17  7:35 ` [pbs-devel] [PATCH proxmox 2/2] apt: updates for changed api (digest as array) Dietmar Maurer
  2024-07-17  9:48 ` [pbs-devel] applied-series: [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dietmar Maurer @ 2024-07-17  7:35 UTC (permalink / raw)
  To: pbs-devel

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
 proxmox-apt-api-types/src/lib.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/proxmox-apt-api-types/src/lib.rs b/proxmox-apt-api-types/src/lib.rs
index 0331ffb6..6025722f 100644
--- a/proxmox-apt-api-types/src/lib.rs
+++ b/proxmox-apt-api-types/src/lib.rs
@@ -185,8 +185,9 @@ pub struct APTRepositoryFile {
     pub content: Option<String>,
 
     /// Digest of the original contents.
+    // We cannot use ConfigDigest here for compatibility reasons.
     #[serde(skip_serializing_if = "Option::is_none")]
-    pub digest: Option<ConfigDigest>,
+    pub digest: Option<[u8; 32]>,
 }
 
 #[api]
-- 
2.39.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] 3+ messages in thread

* [pbs-devel] [PATCH proxmox 2/2] apt: updates for changed api (digest as array)
  2024-07-17  7:35 [pbs-devel] [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Dietmar Maurer
@ 2024-07-17  7:35 ` Dietmar Maurer
  2024-07-17  9:48 ` [pbs-devel] applied-series: [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2024-07-17  7:35 UTC (permalink / raw)
  To: pbs-devel

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
 proxmox-apt/src/repositories/file.rs | 4 ++--
 proxmox-apt/tests/repositories.rs    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-apt/src/repositories/file.rs b/proxmox-apt/src/repositories/file.rs
index 078f6407..f176ab71 100644
--- a/proxmox-apt/src/repositories/file.rs
+++ b/proxmox-apt/src/repositories/file.rs
@@ -200,7 +200,7 @@ impl APTRepositoryFileImpl for APTRepositoryFile {
         }
 
         self.repositories = repos;
-        self.digest = Some(digest);
+        self.digest = Some(*digest);
 
         Ok(())
     }
@@ -221,7 +221,7 @@ impl APTRepositoryFileImpl for APTRepositoryFile {
             }
 
             let (_, current_digest) = self.read_with_digest()?;
-            if digest != &current_digest {
+            if *digest != *current_digest {
                 return Err(self.err(format_err!("digest mismatch")));
             }
         }
diff --git a/proxmox-apt/tests/repositories.rs b/proxmox-apt/tests/repositories.rs
index e4efcab6..5211a360 100644
--- a/proxmox-apt/tests/repositories.rs
+++ b/proxmox-apt/tests/repositories.rs
@@ -137,7 +137,7 @@ fn test_digest() -> Result<(), Error> {
 
     // expect a different digest, because the repo was modified
     let (_, new_digest) = file.read_with_digest()?;
-    assert_ne!(old_digest, new_digest);
+    assert_ne!(old_digest, *new_digest);
 
     assert!(file.write().is_err());
 
-- 
2.39.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] 3+ messages in thread

* [pbs-devel] applied-series: [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array
  2024-07-17  7:35 [pbs-devel] [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Dietmar Maurer
  2024-07-17  7:35 ` [pbs-devel] [PATCH proxmox 2/2] apt: updates for changed api (digest as array) Dietmar Maurer
@ 2024-07-17  9:48 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-07-17  9:48 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dietmar Maurer

Am 17/07/2024 um 09:35 schrieb Dietmar Maurer:
> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
> ---
>  proxmox-apt-api-types/src/lib.rs | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
>

applied both patches, thanks!

I also bumped + upload the apt and apt-api-types packages and bumped the
dependency for apt-api-types in PBS to ensure that the next version bump
there will build with the fixed apt-api-types version.


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-17  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17  7:35 [pbs-devel] [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Dietmar Maurer
2024-07-17  7:35 ` [pbs-devel] [PATCH proxmox 2/2] apt: updates for changed api (digest as array) Dietmar Maurer
2024-07-17  9:48 ` [pbs-devel] applied-series: [PATCH proxmox 1/2] apt-api-types: fix backward compatibility by encoding digest as array Thomas Lamprecht

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