fixed up the repo debug code

i18n
michal 2 years ago
parent 046aac029b
commit e7e107bd46

@ -22,21 +22,23 @@ pub fn sort(a: &[String], verbosity: i32) -> structs::Sorted {
} }
for b in a { for b in a {
let out = Command::new("pacman") let rs = Command::new("pacman")
.arg("-Ss") .arg("-Ss")
.arg(format!("^{}$", &b)) .arg(format!("^{}$", &b))
.stdout(Stdio::null()) .stdout(Stdio::null())
.status() .status()
.expect("Something has gone wrong."); .expect("Something has gone wrong.");
if let Some(0) = out.code() {
repo.push(b.to_string());
}
if rpc::rpcinfo(b.to_string()).found { if rpc::rpcinfo(b.to_string()).found {
if verbosity >= 1 { if verbosity >= 1 {
eprintln!("{} found in AUR.", b); eprintln!("{} found in AUR.", b);
} }
aur.push(b.to_string()); 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 { } else {
if verbosity >= 1 { if verbosity >= 1 {
eprintln!("{} not found.", b); eprintln!("{} not found.", b);

Loading…
Cancel
Save