[darcs-users] darcs patch: resolve issue1124: Test pull.sh failed when run?as root

David Roundy droundy at darcs.net
Wed Oct 8 17:10:53 UTC 2008


On Wed, Oct 08, 2008 at 04:35:31PM +0200, Thorkil Naur wrote:
> Hello,
> 
> On Wednesday 08 October 2008 16:05, David Roundy wrote:
> > On Wed, Oct 08, 2008 at 02:04:51PM +0200, Thorkil Naur wrote:
> > > Wed Oct  8 13:41:34 CEST 2008  Thorkil Naur <naur at post11.tele.dk>
> > >   * resolve issue1124: Test pull.sh failed when run as root
> > 
> > > [resolve issue1124: Test pull.sh failed when run as root
> > > Thorkil Naur <naur at post11.tele.dk>**20081008114134] hunk ./tests/pull.sh 
> 54
> > > +elif whoami | grep root; then
> > > +    echo root never gets permission denied
> > > hunk ./tests/pull.sh 61
> > > +    grep 'permission denied' err
> > > hunk ./tests/pull.sh 64
> > > -if echo $OS | grep -i windows; then
> > > -    echo this test does not work on windows, so ignore it
> > > -else
> > > -    if whoami | grep root; then
> > > -        echo root never gets permission denied
> > > -    else
> > > -        grep 'permission denied' err
> > > -    fi
> > > -fi
> > 
> > It looks a lot like you're removing the windows case here.  Why is
> > that safe?
> 
> The original pull.sh has
> 
> > # set up client repo for failure
> > if echo $OS | grep -i windows; then
> >     echo this test does not work on windows because it
> >     echo is not possible to chmod -r
> > else
> >     chmod a-rwx ./temp1/one # remove all permissions
> >     not darcs pull --repodir ./temp1 -a 2> err
> >     chmod u+rwx temp1/one # restore permission
> >     cat err
> >     rm -rf temp1/one
> > fi
> > if echo $OS | grep -i windows; then
> >     echo this test does not work on windows, so ignore it
> > else
> >     if whoami | grep root; then
> >         echo root never gets permission denied
> >     else
> >         grep 'permission denied' err
> >     fi
> > fi
> 
> so Windows is, needlessly I'd say, being checked for twice.

Ah, thanks! I'll apply then.

David


More information about the darcs-users mailing list