summaryrefslogtreecommitdiffstats
path: root/bin/doins
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-30 19:51:32 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-30 19:51:32 +0000
commit5b9c3611b8dd07c731abf4cb1665163bf627df03 (patch)
treee0b8c0223d355e32419a7755ceda134c261f4d97 /bin/doins
parent6f0731d86c375d481c4214ff5ba7f00af29a8947 (diff)
downloadportage-5b9c3611b8dd07c731abf4cb1665163bf627df03.tar.gz
portage-5b9c3611b8dd07c731abf4cb1665163bf627df03.tar.bz2
portage-5b9c3611b8dd07c731abf4cb1665163bf627df03.zip
* Fix broken return value for doins.
* Make newins cleanup temp files after itself. svn path=/main/trunk/; revision=9634
Diffstat (limited to 'bin/doins')
-rwxr-xr-xbin/doins11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/doins b/bin/doins
index 945938c8b..57a21c4bb 100755
--- a/bin/doins
+++ b/bin/doins
@@ -28,7 +28,7 @@ fi
[[ ! -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}"
@@ -37,7 +37,9 @@ _doins() {
fi
install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}"
+ rval=$?
[[ -n ${cleanup} ]] && rm -f "${cleanup}"
+ return $rval
}
_xdoins() {
@@ -46,6 +48,8 @@ _xdoins() {
done
}
+success=0
+
for x in "$@" ; do
if [ -d "$x" ] ; then
if [ "${DOINSRECUR}" == "n" ] ; then
@@ -63,7 +67,10 @@ for x in "$@" ; do
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