diff options
author | fxqnlr <[email protected]> | 2024-09-29 15:26:46 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-29 15:26:46 +0200 |
commit | d1a9d0d8a8746a63b93f8f14ee4f51b1cd240349 (patch) | |
tree | 662edf641ec51e69d52eeb7578da7237a1466bab | |
parent | aa375d821674cd1feea81e27c2918d0429dd54f6 (diff) | |
download | arbs-d1a9d0d8a8746a63b93f8f14ee4f51b1cd240349.tar arbs-d1a9d0d8a8746a63b93f8f14ee4f51b1cd240349.tar.gz arbs-d1a9d0d8a8746a63b93f8f14ee4f51b1cd240349.zip |
dnf install
-rw-r--r-- | src/packages/dnf.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/packages/dnf.rs b/src/packages/dnf.rs index aad9c8f..6f451ee 100644 --- a/src/packages/dnf.rs +++ b/src/packages/dnf.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use std::process::Command; | 1 | use std::process::{Command, Stdio}; |
2 | 2 | ||
3 | use super::{Package, PackageList, PackageManager}; | 3 | use super::{Package, PackageList, PackageManager}; |
4 | 4 | ||
@@ -46,5 +46,17 @@ impl PackageManager for Dnf { | |||
46 | }) | 46 | }) |
47 | } | 47 | } |
48 | 48 | ||
49 | fn install(&self, _pkgs: Vec<super::Package>) -> Result<()> { todo!() } | 49 | fn install(&self, pkgs: Vec<super::Package>) -> Result<()> { |
50 | let mut args = vec!["dnf".to_string(), "install".to_string(), "--assumeyes".to_string()]; | ||
51 | |||
52 | for pkg in pkgs { | ||
53 | args.push(pkg.id); | ||
54 | } | ||
55 | Command::new("sudo") | ||
56 | .stdout(Stdio::inherit()) | ||
57 | .args(args) | ||
58 | .spawn()? | ||
59 | .wait_with_output()?; | ||
60 | Ok(()) | ||
61 | } | ||
50 | } | 62 | } |