Subject: Re: how to use 'cd' in a do-* target
To: Rhialto <rhialto@falu.nl>
From: Mark E. Perkins <perkinsm@bway.net>
List: tech-pkg
Date: 07/24/2005 10:10:07
On 7/24/05 08:36, Rhialto wrote:
> On Sun 24 Jul 2005 at 07:29:53 -0400, Mark E. Perkins wrote:
> 
>>The problem is that this chokes on 'cd ${FILESDIR}' as follows:
> 
> 
> It can't work anyway, since each line is executed in a new fresh shell,
> so that the cd has no effect on the next command. You should make it all
> into one big command, something like
> 
>  	cd ${FILESDIR};			\
>  	${FETCH_CMD} path/to/file1;	\
>  	${FETCH_CMD} path/to/file2;	\
>  	${FETCH_CMD} path/to/file3;	\
>  	${FETCH_CMD} path/to/file4;

I think I knew this, but was operating on too little caffeine. Anyway, I
followed dillo's suggestion to use the standard fetch target, and all's
well.

> 
> 
>>bmake fetch
>>/bin/mkdir -p /Volumes/NetBSD/pkgsrc/local/testproj/files
>>cd /Volumes/NetBSD/pkgsrc/local/testproj/files
>>bmake: Exec of `cd' failed (No such file or directory)
>>*** Error code 1
> 
> 
> It looks like your command line is not executed with "sh -c" but bmake
> tries to run it directly???

Indeed, but not sure why.

Mark