diff --git a/utils/sh/stow_funcs.sh b/utils/sh/stow_funcs.sh index 6e1459a322..896c3ac1c7 100644 --- a/utils/sh/stow_funcs.sh +++ b/utils/sh/stow_funcs.sh @@ -35,6 +35,10 @@ stow_pkg() [ -z "$pkg" ] && return 2 + if [ ! -w $destdir -o ! -w $XBPS_MASTERDIR ]; then + msg_error "cannot stow $pkg! (permission denied)" + fi + if [ "$build_style" = "meta-template" ]; then [ ! -d $destdir ] && mkdir -p $destdir fi @@ -86,6 +90,10 @@ unstow_pkg() [ -z $pkg ] && msg_error "template wasn't specified?" + if [ ! -w $XBPS_MASTERDIR ]; then + msg_error "cannot unstow $pkg! (permission denied)" + fi + if [ "$pkgname" != "$pkg" ]; then . $XBPS_TEMPLATESDIR/$pkg.tmpl fi