From a8d1be9536bce6d6be2cf1586c8bac049e820d31 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 8 Sep 2024 17:21:27 +0200 Subject: save files, real last modified check (doesn't work correctly) --- src/packages/pacman.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/packages/pacman.rs') diff --git a/src/packages/pacman.rs b/src/packages/pacman.rs index 0a9e1ff..b5be4c0 100644 --- a/src/packages/pacman.rs +++ b/src/packages/pacman.rs @@ -1,13 +1,13 @@ use std::process::Command; -use crate::packages::Package; +use super::{Package, PackageManager}; -use super::PackageManager; +use crate::error::{Error, Result}; pub struct Pacman; impl PackageManager for Pacman { - fn get_installed(&self) -> Vec { + fn get_installed(&self) -> Result> { let pm_pkgs = Command::new("pacman").args(["-Q"]).output().unwrap(); let pm_e_pkgs = Command::new("pacman") .args(["-Q", "--explicit"]) @@ -25,7 +25,7 @@ impl PackageManager for Pacman { }; let split: Vec<&str> = pkg.split_whitespace().collect(); if split.len() != 2 { - panic!("Unknown Pacman Output"); + return Err(Error::UnknownOutput); }; let explicit = pm_e_pkgs_out.contains(pkg); @@ -33,14 +33,14 @@ impl PackageManager for Pacman { pkgs.push(Package { id: split[0].to_string(), version: split[1].to_string(), - explicit + explicit, }) } - pkgs + Ok(pkgs) } - fn install(&self, pkgs: Vec) { + fn install(&self, _pkgs: Vec) { todo!(); } } -- cgit v1.2.3