From 1fda1fa82411fba38ae240c7ab08803cc01166da Mon Sep 17 00:00:00 2001 From: eteryear Date: Tue, 13 Jan 2026 15:43:05 +0300 Subject: [PATCH] Fix `epm download` command exit code if no package can be fetched. --- bin/epm-download | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/epm-download b/bin/epm-download index 58713000c..0d7e866aa 100644 --- a/bin/epm-download +++ b/bin/epm-download @@ -277,9 +277,12 @@ startwith_inlist() return 1 } + # Non-local variable because `local` builtin returns exit code "0" even if command substitution fails. + epm_download_alt__result_url="$(__epm_alt_get_package_url install --reinstall "$@")" || return + # old systems ignore reinstall ? local url - for url in $(__epm_alt_get_package_url install --reinstall "$@") ; do + for url in $epm_download_alt__result_url ; do startwith_inlist "$(basename "$url")" "$@" || continue [ -n "$print_url" ] && echo "$url" && continue # TODO: download together