Sync in every action and make update optional.

This commit is contained in:
Eduard Tolosa 2019-05-12 21:06:09 -05:00
parent fd84ddcf4c
commit 69d7863ae6
3 changed files with 8 additions and 32 deletions

View file

@ -11,11 +11,6 @@ args:
long: setup
help: Setup the clean chroot environment (automatically setup blackarch keyring).
takes_value: false
- update:
short: u
long: update
help: Update BlackArch Linux chroot environment.
takes_value: false
- build:
short: b
long: build
@ -53,10 +48,10 @@ args:
help: Build package files that aren't available in repos. You can specify it multiple times.
multiple: true
takes_value: true
- clean:
short: c
long: clean
help: Clean chroot environment before building.
- update:
short: u
long: update
help: Update chroot environment before building.
takes_value: false
- verbose:
short: v

View file

@ -178,7 +178,6 @@ pub fn update_chroot_packages() {
pub fn build_package() {
sync_chroot();
update_chroot_packages();
let devtools_makechrootpkg = get_vars("makechrootpkg");
let chroot_dir = get_vars("chroot_dir");
let blackarch_instance = get_vars("blackarch_instance");

View file

@ -12,12 +12,7 @@ fn main() {
if matches.is_present("setup") {
functions::setup_chroot();
} else if matches.is_present("build") {
if matches.is_present("clean") {
functions::sync_chroot();
functions::build_package();
} else {
functions::build_package();
}
functions::build_package();
} else if matches.is_present("update") {
functions::update_chroot_packages();
} else if matches.is_present("test") {
@ -29,22 +24,9 @@ fn main() {
.value_of("executable")
.expect("Failed to convert in a valid String")
.to_string();
if matches.is_present("clean") {
functions::sync_chroot();
functions::test_package(&package, &executable);
} else {
functions::test_package(&package, &executable);
}
functions::test_package(&package, &executable);
} else if matches.is_present("install-missing") {
if matches.is_present("clean") {
functions::sync_chroot();
let missing_deps: Vec<&str> = matches.values_of("install-missing").unwrap().collect();
functions::build_package_with_missing_deps(&missing_deps.as_slice());
} else {
let missing_deps: Vec<&str> = matches.values_of("install-missing").unwrap().collect();
functions::build_package_with_missing_deps(&missing_deps.as_slice());
}
} else if matches.is_present("clean") {
functions::sync_chroot();
let missing_deps: Vec<&str> = matches.values_of("install-missing").unwrap().collect();
functions::build_package_with_missing_deps(&missing_deps.as_slice());
}
}