Add support for multiple arguments when testing packages.

Fix #5
This commit is contained in:
Eduard Tolosa 2019-05-16 13:54:17 -05:00
parent 74457ebd8d
commit 916e871fa5
4 changed files with 5 additions and 7 deletions

Binary file not shown.

View file

@ -37,8 +37,9 @@ args:
- executable:
short: e
long: executable
help: Name of the binary file provided by the package that you're installing in the chroot environment.
help: Execute the command to test the package in the chroot environment.
takes_value: true
multiple: true
requires:
- test
- package

View file

@ -356,7 +356,7 @@ pub fn test_package(package: &str, executable: &str) {
)
.unwrap();
Command::new("sudo")
.args(&[&devtools_nspawn, &chroot_blackarch, executable])
.args(&[&devtools_nspawn, &chroot_blackarch, "sh", "-c", &executable])
.status()
.expect(
"Something went wrong while trying to execute the binary in the chroot environment.",

View file

@ -20,11 +20,8 @@ fn main() {
.value_of("package")
.expect("Failed to convert in a valid String")
.to_string();
let executable = matches
.value_of("executable")
.expect("Failed to convert in a valid String")
.to_string();
functions::test_package(&package, &executable);
let executable: Vec<&str> = matches.values_of("executable").unwrap().collect();
functions::test_package(&package, &executable.join(" "));
} else if matches.is_present("install-missing") {
let missing_deps: Vec<&str> = matches.values_of("install-missing").unwrap().collect();
functions::build_package_with_missing_deps(&missing_deps.as_slice());