[darcs-users] setpref test and cwd

Daniel Gorín jcpetruzza at gmail.com
Tue Oct 23 14:18:24 UTC 2007


Ok, now I think I know better, so I'll reply myself. There are two  
issues:

1) my_test.sh needs to be already recorded prior to using it as a  
test-script (that was why the directory looked empty to me)

2) even if it were recorded, the version darcs will try to run may  
not have execution rights, so the command would better have been:  
"darcs setpref test "source my_test.sh" or something similar

Hope this may help someone else (I couldn't find this mentioned in  
the docs, but maybe I didn't look hard enough?)

Daniel

On Oct 23, 2007, at 3:43 PM, Daniel Gorín wrote:

> Hi
>
> I can't figure out how to use 'darcs setpref test' correctly. What  
> I want to do is simply run a script whose path is given relative to  
> the root of my repository. This is a short transcription of what I  
> get:
>
> $ darcs --version
> 1.0.9 (release)
> $ mkdir h
> $ cd h
> $ darcs init
> $ echo "echo testing...." > my_test.sh
> $ chmod +x my_test.sh
> $ darcs setpref test "./my_test.sh"
> Changing value of test from '' to './my_test.sh'
> $ darcs record
> [...mail stuff....]
> changepref test
>
> ./my_test.sh
> Shall I record this change? (1/?)  [ynWsfqadjkc], or ? for help: y
> What is the patch name? a
> Do you want to add a long comment? [yn]n
> Running test...
> /bin/sh: line 1: ./my_test.sh: No such file or directory
> Test failed!
> Looks like you have a bad patch: a.
>
> To see what was going on, I made darcs print the cwd and dir  
> content when executing the script:
>
> $ darcs setpref test 'pwd;ls -la'
> Changing value of test from './my_test.sh' to 'pwd;ls -la'
> $ darcs record
> changepref test
>
> pwd;ls -la
> Shall I record this change? (1/?)  [ynWsfqadjkc], or ? for help: y
> What is the patch name? a
> Do you want to add a long comment? [yn]n
> Running test...
> /private/tmp/testing
> total 0
> drwxr-xr-x   2 daniel  wheel   68 Oct 23 15:29 .
> drwxrwxrwt   9 root    wheel  306 Oct 23 15:29 ..
> Test ran successfully.
> Looks like a good patch.
> Finished recording patch 'a'
>
> So, the problem seems to be darcs not running the test script from  
> the repository. This is not the expected behaviour, is it? Am I  
> doing anything wrong? I get this both on OS X and Linux
>
> Thanks
> Daniel



More information about the darcs-users mailing list