Subject: Re: HOW to pass package internal vars back to shell script?
To: John Refling <johnr@imageworks.com>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-pkg
Date: 01/23/2001 20:17:15
On Tue, Jan 23, 2001 at 12:07:13PM -0800, John Refling wrote:
> I sometimes write shell scripts which manipulate packages and
> would like to get at some of the package internal variables, eg,
> $WRKSRC, $PATCHDIR, etc.  Is there already a way to do this?  If not,
> could the the following target (or similar) be added to bsd.pkg.mk:
> 
> echo:
> 	@${ECHO} $($(ECHO_VAR))
> 
> 
> Then from the pkg directory, one can type
> 
> make ECHO_VAR=WRKSRC echo
> 
> to get the value of $WRKSRC
> 
> This can be used in shell scripts as:
> 
> #!/bin/csh -h
> set ws=`make ECHO_VAR=WRKSRC echo`
> echo Working source directory is $ws

make show-var VARNAME=WRKSRC