Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 new convenience variables and functions

open
nobody
None
5
2004-02-06
2004-02-06
John Williams
No

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.

Discussion

  • John Williams
    John Williams
    2004-02-10

    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".

     
  • John Williams
    John Williams
    2004-03-05

    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.)

     
  • John Williams
    John Williams
    2004-03-05

    even more revised version of patch

     
    Attachments