i18n
Michal S 2 years ago
parent 66d672f4cc
commit 0594ecf5e4
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -14,6 +14,9 @@ pub struct Package {
#[serde(rename = "MakeDepends")]
#[serde(default)]
pub make_depends: Vec<String>,
#[serde(rename = "OptDepends")]
#[serde(default)]
pub opt_depends: Vec<String>,
}
#[derive(serde::Deserialize)]

@ -82,11 +82,41 @@ fn cmd_install(args: InstallArgs, options: Options) {
if !sorted.repo.is_empty() {
// If repo packages found, install them
operations::install(sorted.repo, options);
operations::install(sorted.repo.clone(), options);
}
if !sorted.aur.is_empty() {
// If AUR packages found, install them
operations::aur_install(sorted.aur, options);
operations::aur_install(sorted.aur.clone(), options);
}
// Show optional dependencies for installed packages
info!("Showing optional dependencies for installed packages");
for r in sorted.repo {
info!("{}:", r);
std::process::Command::new("expac")
.args(&["-S", "-l", "\n ", " %O", &r])
.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))
.spawn()
.unwrap()
.wait()
.unwrap();
std::fs::remove_dir_all(&std::path::Path::new(&dir.trim())).unwrap();
}
}

Loading…
Cancel
Save