[[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
_doins() {
- local mysrc="$1" mydir="$2" cleanup=""
+ local mysrc="$1" mydir="$2" cleanup="" rval
if [ -L "$mysrc" ] ; then
cp "$mysrc" "${T}"
fi
install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}"
+ rval=$?
[[ -n ${cleanup} ]] && rm -f "${cleanup}"
+ return $rval
}
_xdoins() {
done
}
+success=0
+
for x in "$@" ; do
if [ -d "$x" ] ; then
if [ "${DOINSRECUR}" == "n" ] ; then
find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \;
find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins
popd >/dev/null
+ ((++success))
else
- _doins "${x}"
+ _doins "${x}" && ((++success))
fi
done
+
+[ $success -gt 0 ] && exit 0 || exit 1
exit 1
fi
-rm -rf "${T}/${2}" && \
-cp -f "${1}" "${T}/${2}" && \
-exec doins "${T}/${2}"
+rm -rf "${T}/${2}" || exit $?
+cp -f "${1}" "${T}/${2}" || exit $?
+doins "${T}/${2}"
+ret=$?
+rm -rf "${T}/${2}"
+exit $ret