Subject: HOW to pass package internal vars back to shell script?
To: None <tech-pkg@netbsd.org>
From: John Refling <johnr@imageworks.com>
List: tech-pkg
Date: 01/23/2001 12:07:13
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