From 1c8b62123cd14e3e46e5fe459e2e66afe8793ba1 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 9 Dec 2008 17:11:40 +0100 Subject: [PATCH] Some checks to be sure that user is able to unstow pkgs. --HG-- extra : convert_revision : 5651565c9e7caefed71d4e39f9285d3f62e613ab --- xbps.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xbps.sh b/xbps.sh index 01e0c0cdd30..15fa5c127a3 100755 --- a/xbps.sh +++ b/xbps.sh @@ -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