From cb9928471e3006bfe11817d4145ba1fc56bbcd2f Mon Sep 17 00:00:00 2001 From: Michal S Date: Mon, 22 Aug 2022 16:33:24 +0100 Subject: [PATCH] Fetch sources when caching --- src/operations/aur_install.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/operations/aur_install.rs b/src/operations/aur_install.rs index 77f9770..f89a64b 100644 --- a/src/operations/aur_install.rs +++ b/src/operations/aur_install.rs @@ -205,6 +205,22 @@ fn clone(pkg: &String, pkgcache: &str, options: &Options) { .arg(format!("{}/{}", url, pkg)) .wait() .silent_unwrap(AppExitCode::GitError); + // Enter directory and `makepkg -o` to fetch sources + if options.verbosity > 1 { + info!("Fetching sources for {}", pkg); + } + info!("Fetching sources"); + set_current_dir(Path::new(&format!( + "{}/{}/{}", + env::var("HOME").unwrap(), + AUR_CACHE, + pkg + ))) + .unwrap(); + ShellCommand::makepkg() + .arg("-o") + .wait() + .silent_unwrap(AppExitCode::MakePkgError); } }