diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/install.sh | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/install.sh b/src/install.sh index da786bd..8447dcc 100644 --- a/src/install.sh +++ b/src/install.sh @@ -195,6 +195,7 @@ install_get_pkgs() { local root="${1}" local status_fd= + local errors= local pkg= local url= local md5sum= @@ -213,6 +214,8 @@ install_get_pkgs() fi status_fd=${FD} + errors=false + for pkg in $(cat "${root}/.prokit/packages"); do info "$(get_msg 'install_downloading_pkg')" "${pkg}" url="$(printf '%s\n' "${install_urls}" | \ @@ -222,19 +225,28 @@ install_get_pkgs() sha256sum="$(printf '%s\n' "${install_sha256sums}" | \ sed -n "s/^${pkg} //p")" fname="var/cache/opkg/archives/${url##*/}" - ${WGET} -q -O "${root}/${fname}" "${url}" || \ - error 2 "$(get_msg 'install_downloading_pkg_fail')" + if ! ${WGET} -q -O "${root}/${fname}" "${url}"; then + error "$(get_msg 'install_downloading_pkg_fail')" + errors=true + continue + fi if [ "x${md5sum}" != 'x' ]; then - printf '%s %s\n' \ - "${md5sum}" "${root}/${fname}" | \ - md5sum -c >/dev/null 2>&1 || \ - error 2 "$(get_msg 'install_checksum_fail')" + if ! printf '%s %s\n' \ + "${md5sum}" "${root}/${fname}" | \ + md5sum -c >/dev/null 2>&1; then + error "$(get_msg 'install_checksum_fail')" + errors=true + continue + fi fi if [ "x${sha256sum}" != 'x' ]; then - printf '%s %s\n' \ - "${sha256sum}" "${root}/${fname}" | \ - ${SHA256SUM} -c >/dev/null 2>&1 || \ - error 2 "$(get_msg 'install_checksum_fail')" + if ! printf '%s %s\n' \ + "${sha256sum}" "${root}/${fname}" | \ + ${SHA256SUM} -c >/dev/null 2>&1; then + error "$(get_msg 'install_checksum_fail')" + errors=true + continue + fi fi info "$(get_msg 'install_unpacking_pkg')" "${pkg}" @@ -288,5 +300,9 @@ install_get_pkgs() fclose ${status_fd} - return 0 + if ! ${errors}; then + return 0 + else + return 1 + fi } |