From 74025f523030cda2782a1fa5020440a87f468d08 Mon Sep 17 00:00:00 2001 From: Michal S Date: Sun, 21 Aug 2022 21:07:06 +0100 Subject: [PATCH] Idk why i made it do that lol --- src/main.rs | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5971ffe..549d240 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,38 +117,15 @@ fn cmd_install(args: InstallArgs, options: Options, cachedir: &str) { // Show optional dependencies for installed packages if packages.len() > 1 { info!("Showing optional dependencies for installed packages"); - for r in sorted.repo { - info!("{}:", r); + for p in packages { + info!("{}:", p); std::process::Command::new("expac") - .args(&["-S", "-l", "\n ", " %O", &r]) + .args(&["-Q", "-l", "\n ", " %O", &p]) .spawn() .unwrap() .wait() .unwrap(); } - for a in sorted.aur { - info!("{}:", a); - let dir_bytes = std::process::Command::new("mktemp") - .arg("-d") - .output() - .unwrap() - .stdout; - let dir = String::from_utf8(dir_bytes).unwrap(); - std::process::Command::new("bash") - .arg("-c") - .arg(format!("\ - cd {} - curl -L https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h={} -o PKGBUILD -s - source PKGBUILD - printf ' %s\\n' \"${{optdepends[@]}}\"\ - ", dir, a)) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait() - .unwrap(); - std::fs::remove_dir_all(&std::path::Path::new(&dir.trim())).unwrap(); - } } }