[darcs-users] $DARCS in bugs/issue558_broken_pipe.sh

Trent W. Buck trentbuck at gmail.com
Fri Oct 24 08:30:22 UTC 2008


Eric Kow <kowey at darcs.net> writes:

> On Fri, Oct 24, 2008 at 18:35:40 +1100, Trent W. Buck wrote:
>> Probably a few months ago, shell_harness used to set DARCS=bin/darcs
>> and then all scripts had to call $DARCS.  And then someone just did
>> PATH=$PWD/bin/:$PATH.  But nobody fixed the script to call "darcs"
>> instead of "$DARCS".  However, I don't want to just make this change
>> in case my guess is wrong.
>
> That sounds right.  Grep and fix might be a good idea.

OK, I've made a note to look into this in my copious free time.

>> I think all tests should start out in a clean directory made by
>> mktemp -d, which is created for them by shell_harness.
>
> Hmm, if you can do this in a way that keeps forensics easy and stupid
> after a test fails, sure.  No trying to figure out where the heck the
> tests dumped their temp directories...

Well, I was thinking something along the lines of my with-temp-dir
script:

    $ with-temp-dir
    with-temp-dir: entering directory `/tmp/with-temp-dir.sDCGfI'
    This directory will be deleted when you exit.

      $ darcs get http://darcs.net/
      Welcome to the darcs stable repository.
      **********************
      Finished getting.
      $ ls
      darcs.net
      $ exit

    with-temp-dir: leaving directory `/tmp/with-temp-dir.sDCGfI'

and non-interactively:

    $ with-temp-dir darcs get http://darcs.net/
    with-temp-dir: entering directory `/tmp/with-temp-dir.qlrzVN'
    Welcome to the darcs stable repository.
    **********************
    Finished getting.
    with-temp-dir: leaving directory `/tmp/with-temp-dir.qlrzVN'
    $

Seems to me the ideal situation is where you make a random temp
directory, and delete if if the script terminates successfully.  But if
the script "tests/foo.sh" fails, you move that temp directory to
"tests/foo.d" (deleting any existing tests/foo.d).



More information about the darcs-users mailing list