attempt to fix #3

main
jan Michal 3 years ago
parent 8eeb2aa841
commit cf1eb4a477
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -1,5 +1,5 @@
use crate::repository::generate;
use crate::{crash, repository, workspace};
use crate::{crash, info, repository, workspace};
use clap::ArgMatches;
pub fn build(matches: &ArgMatches) {
@ -41,11 +41,16 @@ pub fn build(matches: &ArgMatches) {
}
}
let mut errored: Vec<String> = vec![];
for pkg in packages {
if !repos.contains(&pkg) {
crash(format!("Package {} not found in repos in mlc.toml", pkg), 3);
} else {
repository::build(pkg);
let code = repository::build(&pkg);
if code != 0 {
errored.push(pkg);
}
}
}
@ -55,7 +60,10 @@ pub fn build(matches: &ArgMatches) {
.is_present("all")
{
for pkg in repos {
repository::build(pkg);
let code = repository::build(&pkg);
if code != 0 {
errored.push(pkg);
}
}
generate();
}
@ -67,4 +75,8 @@ pub fn build(matches: &ArgMatches) {
{
repository::generate();
}
if !errored.is_empty() {
info(format!("The following packages build jobs returned a non-zero exit code: {}", errored.join(" ")))
}
}

@ -2,8 +2,8 @@ mod config;
mod package;
mod repo;
pub fn build(pkg: String) {
package::build(pkg);
pub fn build(pkg: &str) -> i32 {
package::build(pkg)
}
pub fn generate() {

@ -3,7 +3,7 @@ use std::path::Path;
use std::process::Command;
use std::{env, fs};
pub fn build(pkg: String) {
pub fn build(pkg: &str) -> i32 {
let dir = env::current_dir().unwrap();
if !Path::exists("out".as_ref()) {
fs::create_dir_all("out").unwrap();
@ -14,7 +14,7 @@ pub fn build(pkg: String) {
env::set_current_dir(pkg).unwrap();
Command::new("makepkg")
let a = Command::new("makepkg")
.args(&["-sf", "--skippgpcheck", "--sign", "--noconfirm"])
.spawn()
.unwrap()
@ -29,4 +29,6 @@ pub fn build(pkg: String) {
.unwrap();
env::set_current_dir(dir).unwrap();
a.code().unwrap()
}
Loading…
Cancel
Save