xbps-src: remove target now returns proper return value.

This commit is contained in:
Juan RP 2011-07-05 09:23:29 +02:00
parent 5ae1aab512
commit f1a44611c3

View file

@ -195,7 +195,7 @@ list_pkg_files()
#
remove_pkg()
{
local subpkg ver
local subpkg ver found
[ -z $pkgname ] && msg_error "unexistent package, aborting.\n"
@ -205,20 +205,25 @@ remove_pkg()
for subpkg in ${subpackages}; do
if [ -d "$XBPS_DESTDIR/${subpkg}-${ver%_*}" ]; then
rm -rf "$XBPS_DESTDIR/${subpkg}-${ver%_*}"
found=1
fi
# Remove leftover files in $wrksrc.
if [ -f "${wrksrc}/.xbps_do_install_${subpkg}_done" ]; then
rm -f ${wrksrc}/.xbps_do_install_${subpkg}_done
found=1
fi
done
if [ -d "$XBPS_DESTDIR/${pkgname}-${ver%_*}" ]; then
rm -rf "$XBPS_DESTDIR/${pkgname}-${ver%_*}"
found=1
fi
[ -f $XBPS_PRE_INSTALL_DONE ] && rm -f $XBPS_PRE_INSTALL_DONE
[ -f $XBPS_POST_INSTALL_DONE ] && rm -f $XBPS_POST_INSTALL_DONE
[ -f $XBPS_INSTALL_DONE ] && rm -f $XBPS_INSTALL_DONE
return $?
[ -n "$found" ] && return 0
return 1
}