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

View file

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

View file

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