mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
enh: interactive on errors
This commit is contained in:
parent
e949d99c16
commit
6e20576c5c
2 changed files with 23 additions and 10 deletions
|
@ -332,7 +332,9 @@ TEST_LAUNCHER () {
|
|||
# Execute the test
|
||||
$test_type $test_arg
|
||||
|
||||
[ $? -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result
|
||||
local test_result=$?
|
||||
|
||||
[ $test_result -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result
|
||||
|
||||
# Check that we don't have this message characteristic of a file that got manually modified,
|
||||
# which should not happen during tests because no human modified the file ...
|
||||
|
@ -402,7 +404,7 @@ at_least_one_install_succeeded () {
|
|||
|
||||
break_before_continue () {
|
||||
|
||||
if [ $interactive -eq 1 ]
|
||||
if [ $interactive -eq 1 ] || [ $interactive_on_errors -eq 1 ] && [ ! $test_result -eq 0 ]
|
||||
then
|
||||
echo "To enter a shell on the lxc:"
|
||||
echo " lxc exec $LXC_NAME bash"
|
||||
|
|
|
@ -9,13 +9,18 @@ print_help() {
|
|||
cat << EOF
|
||||
Usage: package_check.sh [OPTION]... PACKAGE_TO_CHECK
|
||||
|
||||
-b, --branch=BRANCH Specify a branch to check.
|
||||
-i, --interactive Wait for the user to continue before each remove.
|
||||
-s, --force-stop Force the stop of running package_check
|
||||
-r, --rebuild (Re)Build the base container
|
||||
(N.B.: you're not supposed to use this option, images
|
||||
are supposed to be fetch from devbaseimgs.yunohost.org automatically)
|
||||
-h, --help Display this help
|
||||
-b, --branch=BRANCH Specify a branch to check.
|
||||
-a, --arch=ARCH
|
||||
-d, --dist=DIST
|
||||
-y, --ynh-branch=BRANCH
|
||||
-i, --interactive Wait for the user to continue before each remove
|
||||
-e, --interactive-on-errors Wait for the user to continue on errors
|
||||
-s, --force-stop Force the stop of running package_check
|
||||
-r, --rebuild (Re)Build the base container
|
||||
(N.B.: you're not supposed to use this option,
|
||||
images are supposed to be fetch from
|
||||
devbaseimgs.yunohost.org automatically)
|
||||
-h, --help Display this help
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
@ -31,6 +36,7 @@ exit 0
|
|||
|
||||
gitbranch=""
|
||||
interactive=0
|
||||
interactive_on_errors=0
|
||||
rebuild=0
|
||||
force_stop=0
|
||||
|
||||
|
@ -65,7 +71,7 @@ function parse_args() {
|
|||
# Initialize the index of getopts
|
||||
OPTIND=1
|
||||
# Parse with getopts only if the argument begin by -
|
||||
getopts ":b:irsh" parameter || true
|
||||
getopts ":b:iresh" parameter || true
|
||||
case $parameter in
|
||||
b)
|
||||
# --branch=branch-name
|
||||
|
@ -77,6 +83,11 @@ function parse_args() {
|
|||
interactive=1
|
||||
shift_value=1
|
||||
;;
|
||||
e)
|
||||
# --interactive-on-errors
|
||||
interactive_on_errors=1
|
||||
shift_value=1
|
||||
;;
|
||||
r)
|
||||
# --rebuild
|
||||
rebuild=1
|
||||
|
|
Loading…
Add table
Reference in a new issue