--- trunk/autoepatch.sh 2006/12/18 09:45:47 5 +++ trunk/autoepatch.sh 2006/12/18 09:57:14 7 @@ -48,9 +48,26 @@ while read target; do for patch in "${patchset}"/*.patch; do - echo $patch - try_patch "${target}" "${patch}" && break; + if try_patch "${target}" "${patch}"; then + PATCH_APPLIED="yes" + break + fi done + + # Check if the patchset requires us to fail if the + # patch is not applied, if there's no patch_required + # function, just skip over + type patch_required &>/dev/null || continue + + if ! type patch_failed_msg &>/dev/null; then + patch_failed_msg() { + eerror "Failed patch ${patchset##*/}" + } + fi + + if [[ -z ${PATCH_APPLIED} ]]; then + patch_required && patch_failed_msg && exit 1 + fi done <<<"${targets}" exit 0