mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-15 08:14:37 +00:00
release: add 'architecture' helper
which returns if a file reference is architecture specific, and for which architecture it is relevant. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
566981077c
commit
f54534cc37
@ -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 {
|
pub fn is_package_index(&self) -> bool {
|
||||||
matches!(self, FileReferenceType::Packages(_, _))
|
matches!(self, FileReferenceType::Packages(_, _))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user