diff options
Diffstat (limited to 'src/packages.rs')
-rw-r--r-- | src/packages.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/packages.rs b/src/packages.rs index 8efc928..3ff997d 100644 --- a/src/packages.rs +++ b/src/packages.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | use std::{fs::File, io::Read}; | 1 | use std::{fs::File, io::Read}; |
2 | 2 | ||
3 | use apt::Apt; | ||
3 | use dnf::Dnf; | 4 | use dnf::Dnf; |
4 | use pacman::Pacman; | 5 | use pacman::Pacman; |
5 | use portage::Portage; | 6 | use portage::Portage; |
@@ -7,6 +8,7 @@ use serde::{Deserialize, Serialize}; | |||
7 | 8 | ||
8 | use crate::error::{Error, Result}; | 9 | use crate::error::{Error, Result}; |
9 | 10 | ||
11 | mod apt; | ||
10 | mod dnf; | 12 | mod dnf; |
11 | mod pacman; | 13 | mod pacman; |
12 | mod portage; | 14 | mod portage; |
@@ -34,6 +36,7 @@ pub struct Package { | |||
34 | 36 | ||
35 | #[derive(Debug, Clone, clap::ValueEnum, Serialize, Deserialize)] | 37 | #[derive(Debug, Clone, clap::ValueEnum, Serialize, Deserialize)] |
36 | pub enum Manager { | 38 | pub enum Manager { |
39 | Apt, | ||
37 | Dnf, | 40 | Dnf, |
38 | Pacman, | 41 | Pacman, |
39 | Portage, | 42 | Portage, |
@@ -65,6 +68,7 @@ impl Manager { | |||
65 | 68 | ||
66 | fn from_str(value: &str) -> Result<Self> { | 69 | fn from_str(value: &str) -> Result<Self> { |
67 | Ok(match value { | 70 | Ok(match value { |
71 | "debian" | "ubuntu" |"linuxmint" => Self::Apt, | ||
68 | "fedora" => Self::Dnf, | 72 | "fedora" => Self::Dnf, |
69 | "arch" => Self::Pacman, | 73 | "arch" => Self::Pacman, |
70 | "gentoo" => Self::Portage, | 74 | "gentoo" => Self::Portage, |
@@ -74,6 +78,7 @@ impl Manager { | |||
74 | 78 | ||
75 | pub fn to_package_manager(&self) -> Box<dyn PackageManager> { | 79 | pub fn to_package_manager(&self) -> Box<dyn PackageManager> { |
76 | match self { | 80 | match self { |
81 | Self::Apt => Box::new(Apt), | ||
77 | Self::Dnf => Box::new(Dnf), | 82 | Self::Dnf => Box::new(Dnf), |
78 | Self::Pacman => Box::new(Pacman), | 83 | Self::Pacman => Box::new(Pacman), |
79 | Self::Portage => Box::new(Portage), | 84 | Self::Portage => Box::new(Portage), |