From ddc026a5ff31340881605c70f085791c19ae20a1 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 21 Dec 2008 09:16:55 +0100 Subject: [PATCH] stow_funcs.sh: fix previous for root(!). --HG-- extra : convert_revision : 618c758ee199429cdc67eb66f9fb6fa2d7972f94 --- utils/sh/stow_funcs.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/sh/stow_funcs.sh b/utils/sh/stow_funcs.sh index 896c3ac1c71..59be265324f 100644 --- a/utils/sh/stow_funcs.sh +++ b/utils/sh/stow_funcs.sh @@ -35,7 +35,8 @@ stow_pkg() [ -z "$pkg" ] && return 2 - if [ ! -w $destdir -o ! -w $XBPS_MASTERDIR ]; then + if [ $(id -u) -ne 0 ] && \ + [ ! -w $destdir -o ! -w $XBPS_MASTERDIR ]; then msg_error "cannot stow $pkg! (permission denied)" fi @@ -90,7 +91,8 @@ unstow_pkg() [ -z $pkg ] && msg_error "template wasn't specified?" - if [ ! -w $XBPS_MASTERDIR ]; then + if [ $(id -u) -ne 0 ] && \ + [ ! -w $XBPS_MASTERDIR ]; then msg_error "cannot unstow $pkg! (permission denied)" fi