summaryrefslogtreecommitdiff
path: root/src/packages
diff options
context:
space:
mode:
Diffstat (limited to 'src/packages')
-rw-r--r--src/packages/dnf.rs16
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 @@
1use std::process::Command; 1use std::process::{Command, Stdio};
2 2
3use super::{Package, PackageList, PackageManager}; 3use 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}