Some checks to be sure that user is able to unstow pkgs.

--HG--
extra : convert_revision : 5651565c9e7caefed71d4e39f9285d3f62e613ab
This commit is contained in:
Juan RP 2008-12-09 17:11:40 +01:00
parent 5885c7583f
commit 1c8b62123c

View file

@ -1383,7 +1383,11 @@ unstow_pkg()
[ "$build_style" = "meta-template" ] && return 0
cd $XBPS_DESTDIR/$pkgname-$ver || exit 1
[ ! -f .xbps-filelist ] && exit 1
if [ ! -f .xbps-filelist ]; then
msg_error "$pkg is incomplete, missing .xbps-filelist file."
elif [ ! -O .xbps-filelist ]; then
msg_error "$pkg cannot be removed (permission denied)."
fi
for f in $(cat .xbps-filelist|sort -ur); do
if [ -f $XBPS_MASTERDIR/$f -o -h $XBPS_MASTERDIR/$f ]; then