[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Environment variables vs. command-line arguments



Hi Jonathan,

On Thu, Feb 05, 2009 at 09:57:31AM -0600, Jonathan Hall wrote:
> It seems there is quite a hodge-podge of calling conventions for passing  
> config variables to the scripts in the tools/ directory.  Several  
> scripts take command line arguments; others use environment variables.   
> Some use both.
>
> Is there a method to this madness?
>
> It seems to me that it would be easier to use the environment for  
> standard config variables (such as MIRROR, NONFREE, etc, etc)
>
> which_deb, for instance, takes the config variables of MIRROR and  
> CODENAME as its first two arguments, followed by a package name and  
> output format (which I believe should be arguments).  Is there a reason  
> this couldn't be read from the environment?  (Thus making it more  
> consistent with other scripts, as well as more expandable, IMO)

It's basically historical accident in a few cases, I'll admit. Some of
the scripts have been written by different people at different times,
with differing ideas about how to do things. Some of the scripts may
also be called in different contexts where we may or may not have the
environment set up appropriately.

Patches / suggestions welcome to start cleaning things up, although
obviously major changes will have to be post-lenny now..

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
  Mature Sporty Personal
  More Innovation More Adult
  A Man in Dandism
  Powered Midship Specialty


Reply to: