From ec30fbab6ea45dcdec7d242fba2ff5555fea8e02 Mon Sep 17 00:00:00 2001 From: fx Date: Mon, 23 Sep 2024 18:56:39 +0200 Subject: add dnf package manager --- src/packages.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/packages.rs') diff --git a/src/packages.rs b/src/packages.rs index de818f4..2844a9b 100644 --- a/src/packages.rs +++ b/src/packages.rs @@ -1,11 +1,13 @@ use std::{fs::File, io::Read}; +use dnf::Dnf; use pacman::Pacman; use portage::Portage; use serde::{Deserialize, Serialize}; use crate::error::{Error, Result}; +mod dnf; mod pacman; mod portage; @@ -32,6 +34,7 @@ pub struct Package { #[derive(Debug, Clone, clap::ValueEnum, Serialize, Deserialize)] pub enum Manager { + Dnf, Pacman, Portage, } @@ -65,6 +68,7 @@ impl Manager { fn from_str(value: &str) -> Result> { Ok(match value { + "fedora" => Box::new(Dnf), "arch" => Box::new(Pacman), "gentoo" => Box::new(Portage), _ => return Err(Error::Unsupported), @@ -73,6 +77,7 @@ impl Manager { fn to_package_manager(&self) -> Box { match self { + Self::Dnf => Box::new(Dnf), Self::Pacman => Box::new(Pacman), Self::Portage => Box::new(Portage), } -- cgit v1.2.3