From e7e107bd466b01d24b016bb421d9039501580528 Mon Sep 17 00:00:00 2001 From: michal Date: Mon, 17 Jan 2022 18:00:30 +0000 Subject: [PATCH] fixed up the repo debug code --- src/internal/sort.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/internal/sort.rs b/src/internal/sort.rs index 3adf350..3930f0c 100644 --- a/src/internal/sort.rs +++ b/src/internal/sort.rs @@ -22,21 +22,23 @@ pub fn sort(a: &[String], verbosity: i32) -> structs::Sorted { } for b in a { - let out = Command::new("pacman") + let rs = Command::new("pacman") .arg("-Ss") .arg(format!("^{}$", &b)) .stdout(Stdio::null()) .status() .expect("Something has gone wrong."); - if let Some(0) = out.code() { - repo.push(b.to_string()); - } if rpc::rpcinfo(b.to_string()).found { if verbosity >= 1 { eprintln!("{} found in AUR.", b); } aur.push(b.to_string()); + } else if let Some(0) = rs.code() { + if verbosity >= 1 { + eprintln!("{} found in repos.", b) + } + repo.push(b.to_string()); } else { if verbosity >= 1 { eprintln!("{} not found.", b);