Add return code to local deb install failure

This commit is contained in:
2024-11-04 12:02:56 -05:00
parent 76370a8be8
commit 98f898f0e3

View File

@@ -480,22 +480,22 @@ install_package() {
# Generate installation flags based on the distribution # Generate installation flags based on the distribution
case $ID in case $ID in
debian|ubuntu) debian|ubuntu)
(( allow_downgrades )) && install_flags+=(--allow-downgrades) ((allow_downgrades)) && install_flags+=(--allow-downgrades)
;; ;;
fedora|centos) fedora|centos)
(( allow_downgrades )) && install_flags+=(--allowerasing) ((allow_downgrades)) && install_flags+=(--allowerasing)
(( no_gpg_check )) && install_flags+=(--nogpgcheck) ((no_gpg_check)) && install_flags+=(--nogpgcheck)
(( refresh )) && install_flags+=(--refresh) ((refresh)) && install_flags+=(--refresh)
;; ;;
suse) suse)
(( no_gpg_check )) && install_flags+=(--allow-unsigned-rpm) ((no_gpg_check)) && install_flags+=(--allow-unsigned-rpm)
;; ;;
esac esac
# Install packages if any need installation # Install packages if any need installation
if [[ ${#pkg_array[@]} -gt 0 ]]; then if [[ ${#pkg_array[@]} -gt 0 ]]; then
if ! "${PKG_INSTALL[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then if ! "${PKG_INSTALL[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then
(( silent )) || err "Failed to install ${pkg_array[*]}." ((silent)) || err "Failed to install ${pkg_array[*]}"
return 1 return 1
fi fi
fi fi
@@ -887,6 +887,8 @@ install_mc_deb() {
if ask_ok "Remove source DEB and retry"; then if ask_ok "Remove source DEB and retry"; then
execute rm -f "$MC_DEB" execute rm -f "$MC_DEB"
exec "$SCRIPT_PATH" "$@" "--no-update" exec "$SCRIPT_PATH" "$@" "--no-update"
else
return 1
fi fi
fi fi
} }