xbps-src: remove a pkg thru the chroot handler to fix some bugs in pre/post_remove funcs.

This commit is contained in:
Juan RP 2011-06-16 12:21:12 +02:00
parent 88d2739d94
commit c912ce0eef
3 changed files with 9 additions and 8 deletions

View File

@ -247,7 +247,7 @@ xbps_chroot_handler()
[ "$action" != "configure" -a "$action" != "build" -a \
"$action" != "install" -a "$action" != "chroot" -a \
"$action" != "install-destdir" ] && return 1
"$action" != "install-destdir" -a "$action" != "remove" ] && return 1
if [ ! -f $XBPS_MASTERDIR/.xbps_perms_done ]; then
echo -n "==> Preparing chroot on $XBPS_MASTERDIR... "

View File

@ -161,12 +161,10 @@ stow_pkg_real()
#
unstow_pkg_real()
{
local f ver lpwd
local f ver
[ -z $pkgname ] && return 1
lpwd=$(pwd)
if [ $(id -u) -ne 0 ] && \
[ ! -w $XBPS_MASTERDIR ]; then
msg_error "cannot unstow $pkgname! (permission denied)\n"
@ -214,8 +212,6 @@ unstow_pkg_real()
rm -rf $XBPS_PKGMETADIR/$pkgname
# Unregister pkg from plist file.
$XBPS_PKGDB_CMD unregister $pkgname $ver || return $?
cd ${lwd}
$XBPS_PKGDB_CMD unregister $pkgname $ver
return $?
}

View File

@ -412,7 +412,12 @@ remove)
_pkgname=$(basename_cwd)
fi
setup_tmpl ${_pkgname}
remove_pkg
if [ -z "$in_chroot" -a -z "$base_chroot" ]; then
. $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_pkgname} $dontrm_builddir
else
remove_pkg
fi
;;
stow)
stow_flag=yes