Add Package example to main
Add remove method to pacman/apt package managers
This commit is contained in:
parent
0f85701cc4
commit
f26f1c1bf2
6 changed files with 94 additions and 15 deletions
|
|
@ -28,7 +28,12 @@ impl SpecificPackageManager for DebianPackageManager {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn remove(&self, _list: PackageList) -> Result<(), PackageError> {
|
||||
todo!()
|
||||
fn remove(&self, list: PackageList) -> Result<(), PackageError> {
|
||||
let res = Cmd::new("apt").arg("remove").args(list.list()).run()?;
|
||||
|
||||
if ! res.success {
|
||||
return Err(PackageError::CmdFail(res));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue