From 080751d44a081d5a974d7406a9f79b63f67604e8 Mon Sep 17 00:00:00 2001 From: David Leverton Date: Tue, 3 Nov 2015 18:14:44 +0000 Subject: Proper error handling for dodoc --- paludis/repositories/e/ebuild/utils/dodoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paludis/repositories/e/ebuild/utils/dodoc b/paludis/repositories/e/ebuild/utils/dodoc index c026e6e10..cb4698b3e 100755 --- a/paludis/repositories/e/ebuild/utils/dodoc +++ b/paludis/repositories/e/ebuild/utils/dodoc @@ -52,14 +52,17 @@ for x in "$@"; do if $recurse && [[ -d "${x}" ]] ; then ( export DOCDESTTREE="${DOCDESTTREE}/${x}" - cd "${x}" - ls * >/dev/null 2>&1 && dodoc -r * - ) + if ! cd "${x}" ; then + false + elif ls * >/dev/null 2>&1 ; then + dodoc -r * + fi + ) || ret=2 elif [[ -d "${x}" ]] ; then echo "${0}: ${x} is a directory but we are not recursing" >&2 ret=1 elif [[ -s "${x}" ]]; then - install -m0644 "${x}" "${dir}" + install -m0644 "${x}" "${dir}" || ret=2 elif [[ ! -e "${x}" ]]; then echo "${0}: ${x} does not exist" >&2 ret=2 -- cgit v1.2.3