diff options
author | fxqnlr <[email protected]> | 2024-09-08 23:59:39 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-08 23:59:39 +0200 |
commit | 97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7 (patch) | |
tree | 5a7840bb1905bd84ba95cca11b74762fd028f3d0 /src/packages/pacman.rs | |
parent | 9a34651063029394845a3e18fe7afd5b7c4db777 (diff) | |
download | arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.tar arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.tar.gz arbs-97896023cf5b8ac9a58baaba7d0571b0cc9ff8f7.zip |
add logging
Diffstat (limited to 'src/packages/pacman.rs')
-rw-r--r-- | src/packages/pacman.rs | 18 |
1 files changed, 14 insertions, 4 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 @@ | |||
1 | use std::process::Command; | 1 | use std::process::{Command, Stdio}; |
2 | 2 | ||
3 | use super::{Package, PackageManager}; | 3 | use 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 | } |