summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-04 17:00:27 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-04 17:00:27 +0000
commitb49457645e1265383c4eff2b663d93005646bfb9 (patch)
tree7f7c3e72ff093c50cd7413ce9b1163cd6e35e78b /bin
parentfa91d88b687a9079c4ab2da47571392d10698fc9 (diff)
downloadportage-b49457645e1265383c4eff2b663d93005646bfb9.tar.gz
portage-b49457645e1265383c4eff2b663d93005646bfb9.tar.bz2
portage-b49457645e1265383c4eff2b663d93005646bfb9.zip
Bug #299248 - Fix doins return code handling to make sure it always fails
when appropriate. Thanks to Jonathan Callen <abcd@g.o> for the initial patch. svn path=/main/trunk/; revision=15158
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-helpers/doins23
1 files changed, 20 insertions, 3 deletions
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index 7e1a9ca95..cf4644770 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -63,12 +63,20 @@ _doins() {
}
_xdoins() {
+ local -i success=0 failed=0
while read -d $'\0' x ; do
_doins "$x" "${x%/*}"
+ if [[ $? -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
done
+ [[ $failed -ne 0 || $success -eq 0 ]] && return 1 || return 0
}
success=0
+failed=0
for x in "$@" ; do
if [[ $PRESERVE_SYMLINKS = n && -d $x ]] || \
@@ -100,15 +108,24 @@ for x in "$@" ; do
fi
find "$x_orig" -type d -exec dodir "${INSDESTTREE}/{}" \;
find "$x_orig" \( -type f -or -type l \) -print0 | _xdoins
+ if [[ ${PIPESTATUS[1]} -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
if [[ $x != $x_orig ]] ; then
popd >/dev/null
mv "$TMP/1/$x_orig" "$x"
fi
while popd >/dev/null 2>&1 ; do true ; done
- ((success|=1))
else
- _doins "${x}" && ((success|=1))
+ _doins "${x}"
+ if [[ $? -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
fi
done
rm -rf "$TMP"
-[ $success -gt 0 ] && exit 0 || exit 1
+[[ $failed -ne 0 || $success -eq 0 ]] && exit 1 || exit 0