fix: remove useless threading

This commit is contained in:
Strix 2023-10-14 22:39:44 +02:00
parent 6cd0af304f
commit 6981fe8f16
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
9 changed files with 157 additions and 38 deletions

View file

@ -1,4 +1,4 @@
use log::trace;
use log::{info, trace};
pub mod fetch;
pub mod identifier;
@ -51,12 +51,26 @@ impl Package {
}
/// Install the package.
pub fn install(&mut self) -> Result<(), installer::errors::InstallError> {
pub fn install(&mut self, build: bool) -> Result<(), installer::errors::InstallError> {
let manifest = self.manifest();
let installer = installer::PackageInstaller::new(
let mut installer = installer::PackageInstaller::new(
manifest.clone(),
self.pkgfile.clone(),
installer::InstallType::Bin,
if build {
info!("building package: {}...", if self.manifest().package.name.is_empty() {
self.identifier.to_string()
} else {
self.manifest().package.name
});
installer::InstallType::Build
} else {
info!("using binary install for package: {}...", if self.manifest().package.name.is_empty() {
self.identifier.to_string()
} else {
self.manifest().package.name
});
installer::InstallType::Bin
},
);
match installer.install() {
Ok(_) => {