summaryrefslogtreecommitdiff
path: root/src/packages
diff options
context:
space:
mode:
Diffstat (limited to 'src/packages')
-rw-r--r--src/packages/pacman.rs18
-rw-r--r--src/packages/portage.rs5
2 files changed, 18 insertions, 5 deletions
diff --git a/src/packages/pacman.rs b/src/packages/pacman.rs
index b5be4c0..e10c6fb 100644
--- a/src/packages/pacman.rs
+++ b/src/packages/pacman.rs
@@ -1,4 +1,4 @@
1use std::process::Command; 1use std::process::{Command, Stdio};
2 2
3use super::{Package, PackageManager}; 3use super::{Package, PackageManager};
4 4
@@ -34,13 +34,23 @@ impl PackageManager for Pacman {
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 Ok(pkgs) 40 Ok(pkgs)
41 } 41 }
42 42
43 fn install(&self, _pkgs: Vec<super::Package>) { 43 fn install(&self, pkgs: Vec<super::Package>) -> Result<()> {
44 todo!(); 44 let mut args = vec!["--noconfirm".to_string(), "-S".to_string()];
45
46 for pkg in pkgs {
47 args.push(pkg.id);
48 }
49 Command::new("pacman")
50 .stdout(Stdio::inherit())
51 .args(args)
52 .spawn()?
53 .wait_with_output()?;
54 Ok(())
45 } 55 }
46} 56}
diff --git a/src/packages/portage.rs b/src/packages/portage.rs
index 6b9e508..f9a760b 100644
--- a/src/packages/portage.rs
+++ b/src/packages/portage.rs
@@ -1,3 +1,5 @@
1use tracing::error;
2
1use super::PackageManager; 3use super::PackageManager;
2 4
3pub struct Portage; 5pub struct Portage;
@@ -7,7 +9,8 @@ impl PackageManager for Portage {
7 todo!() 9 todo!()
8 } 10 }
9 11
10 fn install(&self, pkgs: Vec<super::Package>) { 12 fn install(&self, pkgs: Vec<super::Package>) -> crate::error::Result<()> {
13 error!("Install {pkgs:?}");
11 todo!() 14 todo!()
12 } 15 }
13} 16}