Re: Hidden argument passing in simple-cdd
On Sun, Nov 04, 2007 at 12:58:02PM -0800, Bruce Korb wrote:
> There is this mechanism available for setting option values via a
> "config" file. Since there were a lot of parameters and some of them
> did not have supporting command line options, I used the config file.
sure. that's what it's there for.
> The problem is that some of these get passed through to the
> "debian-cd" script via the non-exported variable "commandline_opts".
are you talking about the code snippet from simple-cdd,
tools/build/debian-cd, or debian-cd itself?
tools/build/debian-cd is not a script that is run, but rather
included/sourced into build-simple-cdd. the vast majority of the code
was part of a monolithic build-simple-cdd at one point, but was split
out to make it easier to use alternate build tools.
> The problem with the scheme is that the behavior is unexpected and the
> data stuffed into the file "commandline" is actually arguments to the
> build-simple-cdd program, not the arguments for another sub-program
> buried deep within the bowels of the debian-cd project.
> If they happen to correspond, well and good, but the transcription
> should be explicit.
i'm having trouble following what you're saying here ... is having
commmandline_opts defined somehow breaking debian-cd or
build-simple-cdd? or do you simply not like how or what it does?
"commandline_opts" is really just used as a way to create a log of the
commandline arguments used to build the CD, so you can easily figure out
what is needed to re-create the CD. it's not used for anything other
than that, and probably shouldn't be used for anything else.
i could add more comments in the code, rename the variable
"build_simple_cdd_commandline_opts" if that makes it clearer, or even
happily remove the two lines of code entirely, if it really causes
problems.
but i don't quite understand what the issue is...
> Anyway, here's a little chunk of code to add in immediately after
> processing options.
probably worth re-designing commandline processing entirely. i don't
like how adding a commandline option currently involves editing 2-3
different places. maybe create a function or two that build the
help text, commandline options, and value setting all at once, and
process it with getopt (this is what ltsp-build-client from the
ltsp-server package does).
live well,
vagrant
Reply to: