On Tue, Jan 30, 2007 at 09:44:06AM -0500, Zachary P. Landau wrote:
> > I suspect that what's happening is that darcs is setting the working
> > directory to the root directory in a naive attempt to put ourselves into
> > the main directory of a repository, and my user doesn't have write
> > permissions there for creating a temporary file.
> 
> When specifying a remote repository, the path to the temporary file was
> '//'.  So it would try to create files in the root of the filesystem.
> If you run "darcs changes --last 1 --repo http://darcs.net"; as root it
> works because of this.
> 
> Attached is a patch that uses tempdir_loc for withTemp.  Can anyone
> think of a reason that makes this a bad idea?

tempdir_loc can sometimes fall back to returning current dir,
but of course noting is lost by that. The only thing I can think
of is if the command is run in an existing repo's root dir, in
which case tempdir_loc can sometimes fall back to that repo's
locally specified temp dir (specified in
_darcs/prefs/...something). Not that there's anything wrong with
that... but you know how users are, they put some trigger on
that special dir to light up the Christmas tree and won't
understand why on earth it lights up when they access a totally
different, remote repo... :-)

> I wrote a test for this too, but I'm not sure how to go about making it
> fail.  To do so, we have to be outside of the repository completely
> (running in tests/ doesn't work because it goes back a dir to find a
> repo).  I'm not sure how we can guarantee we will be outside of the
> repository.  If anyone has any ideas, I'll update the test and send it.

You could test for the presence of a /tmp directory (and make
sure it doesn't contain a _darcs dir) and use it or else just
skip the test.


-- 
Tommy Pettersson <[EMAIL PROTECTED]>
_______________________________________________
darcs-devel mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-devel

Reply via email to