|
From: Jason B. <amn...@gm...> - 2010-01-24 13:12:04
|
I'm using configobj for envbuilder[1]. There's one place where I'm a
bit stuck and I'm curious if there's any way around it. Essentially,
I have a section that defines a set of packages (parcels) to be
checked out from SCM, and another section that defines commands to be
run against all parcels. Here's the example from the readme:
[project]
parcels = 'envbuilder', # Note the comma
[[DEFAULT]]
git_checkout = 'git clone $url'
cwd = '/home/jason/src/envbuilder-src'
python = '$cwd/bin/python'
[[envbuilder]]
dir = 'envbuilder'
url = 'git://github.com/jasonbaker/envbuilder.git'
setup = '$python setup.py develop'
checkout = '$git_checkout'
[commands]
[[ status ]]
required = True
default = 'git status'
working_dir = '$$PARCEL_WD'
help = 'Check the status of all checked-out parcels'
The working_dir's value of $$PARCEL_WD is a bit of a hack. I just go
in and substitute the parcel's working directory for $PARCEL_WD
*after* interpolation has already run. What would be nice is if I
could access the parcel's option dir. Bear in mind that since parcels
are defined as a __many__ subsection, I need to get the value for
*each* parcel.
I understand that this will likely require me to write some code
somewhere (either in configobj or in envbuilder), but can someone help
me figure out the best way to go about solving this problem?
[1] http://github.com/jasonbaker/envbuilder
|