]> git.proxmox.com Git - proxmox-apt.git/blobdiff - src/deb822/release_file.rs
release: fix typo in 'Acquire-By-Hash'
[proxmox-apt.git] / src / deb822 / release_file.rs
index 2b7245b9f89724462cfb1480f663a083192678ff..355b2461d2220338313240f2e66e8608ec5220da 100644 (file)
@@ -228,6 +228,22 @@ impl FileReferenceType {
         }
     }
 
+    pub fn architecture(&self) -> Option<&Architecture> {
+        match self {
+            FileReferenceType::Commands(arch, _)
+            | FileReferenceType::Contents(arch, _)
+            | FileReferenceType::ContentsUdeb(arch, _)
+            | FileReferenceType::Packages(arch, _) => Some(arch),
+            FileReferenceType::PseudoRelease(arch) => arch.as_ref(),
+            FileReferenceType::Unknown
+            | FileReferenceType::PDiff
+            | FileReferenceType::Sources(_)
+            | FileReferenceType::Dep11(_)
+            | FileReferenceType::Translation(_)
+            | FileReferenceType::Ignored => None,
+        }
+    }
+
     pub fn is_package_index(&self) -> bool {
         matches!(self, FileReferenceType::Packages(_, _))
     }
@@ -326,7 +342,7 @@ impl TryFrom<ReleaseFileRaw> for ReleaseFile {
         parsed.suite = value.suite;
         parsed.version = value.version;
 
-        parsed.aquire_by_hash = match value.extra_fields.get("Aquire-By-Hash") {
+        parsed.aquire_by_hash = match value.extra_fields.get("Acquire-By-Hash") {
             Some(val) => *val == "yes",
             None => false,
         };