new convenience variables and functions
Brought to you by:
vimboss
This patch adds the following variables and functions:
$STARTDIR: the directory of the toplevel recipe
relative to the current recipe
$PARENTDIR: the directory of the parent recipe relative
to the current recipe
$CURDIR: `os.getcwd()`, just like in GNU make
$RECIPE: the basename of the current recipe file
startdir(), parentdir(): analgous to topdir() and
childdir(), but for $STARTDIR and $PARENTDIR
I also generalized path path handling in Utils.py with
more use of the os.path module.
I'm not sure if these work right in the presence of
":cd" commands, but then I'm not sure TOPDIR and
CHILDDIR work either.
Logged In: YES
user_id=44174
I changed STARTDIR and startdir to BASEDIR and basedir,
since I discovered that this is what Apache Ant does, and
it's the only build tool I'm aware of that offers a similar
feature. Plus it makes the names a character shorter, and
"base" looks less like a verb than "start".
Logged In: YES
user_id=44174
Oops, I was forgetting to run the unit tests! Now the patch
doesn't break the tests anymore. I also got rid of the
basedir() and parentdir() functions since they're not needed
in my use case that motivated that addition of $BASEDIR and
$PARENTDIR doesn't need these functions. (The use case, BTW,
is a child recipe in a subdirectory that uses files in the
subdirectory to build a target in the top-level directory.)
even more revised version of patch