summaryrefslogtreecommitdiff
path: root/src/packages/pacman.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/packages/pacman.rs')
-rw-r--r--src/packages/pacman.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/packages/pacman.rs b/src/packages/pacman.rs
index 0a9e1ff..b5be4c0 100644
--- a/src/packages/pacman.rs
+++ b/src/packages/pacman.rs
@@ -1,13 +1,13 @@
1use std::process::Command; 1use std::process::Command;
2 2
3use crate::packages::Package; 3use super::{Package, PackageManager};
4 4
5use super::PackageManager; 5use crate::error::{Error, Result};
6 6
7pub struct Pacman; 7pub struct Pacman;
8 8
9impl PackageManager for Pacman { 9impl PackageManager for Pacman {
10 fn get_installed(&self) -> Vec<super::Package> { 10 fn get_installed(&self) -> Result<Vec<super::Package>> {
11 let pm_pkgs = Command::new("pacman").args(["-Q"]).output().unwrap(); 11 let pm_pkgs = Command::new("pacman").args(["-Q"]).output().unwrap();
12 let pm_e_pkgs = Command::new("pacman") 12 let pm_e_pkgs = Command::new("pacman")
13 .args(["-Q", "--explicit"]) 13 .args(["-Q", "--explicit"])
@@ -25,7 +25,7 @@ impl PackageManager for Pacman {
25 }; 25 };
26 let split: Vec<&str> = pkg.split_whitespace().collect(); 26 let split: Vec<&str> = pkg.split_whitespace().collect();
27 if split.len() != 2 { 27 if split.len() != 2 {
28 panic!("Unknown Pacman Output"); 28 return Err(Error::UnknownOutput);
29 }; 29 };
30 30
31 let explicit = pm_e_pkgs_out.contains(pkg); 31 let explicit = pm_e_pkgs_out.contains(pkg);
@@ -33,14 +33,14 @@ impl PackageManager for Pacman {
33 pkgs.push(Package { 33 pkgs.push(Package {
34 id: split[0].to_string(), 34 id: split[0].to_string(),
35 version: split[1].to_string(), 35 version: split[1].to_string(),
36 explicit 36 explicit,
37 }) 37 })
38 } 38 }
39 39
40 pkgs 40 Ok(pkgs)
41 } 41 }
42 42
43 fn install(&self, pkgs: Vec<Package>) { 43 fn install(&self, _pkgs: Vec<super::Package>) {
44 todo!(); 44 todo!();
45 } 45 }
46} 46}