Skip to content

Commit e80671a

Browse files
committed
[fix] : Fixed pyalpm error
1 parent afe8d21 commit e80671a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

build.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,14 @@ prepare_env() {
364364
if [[ "${nodepend}" = false ]]; then
365365
local _check_failed=false _pkg _result=0
366366
msg_info "Checking dependencies ..."
367+
if pacman -Qq pyalpm > /dev/null 2>&1; then
368+
msg_error "pyalpm is not installed." 1
369+
fi
367370
for _pkg in "${dependence[@]}"; do
368371
eval "${tools_dir}/package.py" "${_pkg}" "$( [[ "${debug}" = false ]] && echo "> /dev/null")" || _result="${?}"
369-
case "${_result}" in
370-
"3")
371-
_check_failed=true
372-
;;
373-
"4")
374-
[[ "${debug}" = true ]] && echo
375-
msg_error "pyalpm is not installed." ; exit 1
376-
;;
377-
esac
372+
if (( _result == 3 )) || (( _result == 4 )); then
373+
_check_failed=true
374+
fi
378375
_result=0
379376
done
380377
if [[ "${_check_failed}" = true ]]; then exit 1; fi

0 commit comments

Comments
 (0)