On Tue, 2011-01-04 at 09:42 +1000, Peter Hutterer wrote:

> > +check_writable_dir () {
> > +    if [ X"$SUDO" = X ]; then
> 
> skip this check, just because it's sudo doesn't mean you can write to
> the directory.

On the other hand, without this test, a user running build.sh with -s
<sudo> will always erroneously have the error message if he has write
permission only with sudo. The script aborts and there is no workaround.

With the (not fool proof) test for sudo, running:

        $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install

will fail if the user does not have write permission. This is what we
have today, no early detection.

Either I accept that early detection is not always possible, or I remove
the function all together. 

> 
> also, for readability, you may want to add a line of 
> dir="$1"
> 
> and then use $dir instead of $1 in the remainder.
> 

Agreed

> Cheers,
>   Peter
> 
> > +     if [ ! -d "$1" ] || [ ! -w "$1" ]; then
> > +         echo "The path \"$1\" supplied by \"$2\" must be a
> writable directory"
> > +         echo ""
> > +         usage
> > +         exit 1
> > +     fi
> > +    fi
> > +}
> 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to