[pve-devel] [PATCH proxmox-offline-mirror 4/4] mirror: use new architecture helper

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Sep 15 15:09:18 CEST 2022


in order to avoid having a list of arch-specific references on two
places.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
requires proxmox-apt > 0.9.1 with the new helper

 src/mirror.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mirror.rs b/src/mirror.rs
index 6cbd680..3370ca4 100644
--- a/src/mirror.rs
+++ b/src/mirror.rs
@@ -501,14 +501,14 @@ pub fn create_snapshot(
             || match &reference.file_type {
                 FileReferenceType::Ignored => true,
                 FileReferenceType::PDiff => true, // would require fetching the patches as well
-                FileReferenceType::Contents(arch, _)
-                | FileReferenceType::ContentsUdeb(arch, _)
-                | FileReferenceType::Packages(arch, _)
-                | FileReferenceType::PseudoRelease(Some(arch)) => {
-                    !binary || !config.architectures.contains(arch)
-                }
                 FileReferenceType::Sources(_) => !source,
-                _ => false,
+                _ => {
+                    if let Some(arch) = reference.file_type.architecture() {
+                        !binary || !config.architectures.contains(arch)
+                    } else {
+                        false
+                    }
+                }
             };
         if skip {
             println!("Skipping {}", reference.path);
-- 
2.30.2






More information about the pve-devel mailing list