Environment variables vs. command-line arguments

2009-02-05 Thread Jonathan Hall
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)


--
Jonathan


--
Inbound and outbound email scanned for spam and viruses by the

DoubleCheck Email Manager: http://www.doublecheckemail.com


--
To UNSUBSCRIBE, email to debian-cd-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Environment variables vs. command-line arguments

2009-02-05 Thread Steve McIntyre
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.st...@einval.com
  Mature Sporty Personal
  More Innovation More Adult
  A Man in Dandism
  Powered Midship Specialty


-- 
To UNSUBSCRIBE, email to debian-cd-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Environment variables vs. command-line arguments

2009-02-05 Thread Frans Pop
On Thursday 05 February 2009, 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).

I agree. MIRROR should definitely not be passed in as an argument 
as "local" can have a different mirror path (LOCALDEBS) from the main 
mirror (MIRROR). which_deb should support that.

P.S. Are you subscribed to the list or should we continue to CC you?


signature.asc
Description: This is a digitally signed message part.


Re: Environment variables vs. command-line arguments

2009-02-05 Thread Jonathan Hall

I'm on the list.

I agree. MIRROR should definitely not be passed in as an argument 
as "local" can have a different mirror path (LOCALDEBS) from the main 
mirror (MIRROR). which_deb should support that.
  
That's exactly what I was running into... trying to expand to support 
"other" components, I realized I can't easily support MIRROR, LOCAL, and 
OTHER using command-line arguments.

P.S. Are you subscribed to the list or should we continue to CC you?
  

I am on the list.


--
Inbound and outbound email scanned for spam and viruses by the

DoubleCheck Email Manager: http://www.doublecheckemail.com


--
To UNSUBSCRIBE, email to debian-cd-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Environment variables vs. command-line arguments

2009-02-05 Thread Jonathan Hall
Do you prefer to have cleanup patches submitted to the list, or as 
wishlist bugs?



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

  



--
Inbound and outbound email scanned for spam and viruses by the

DoubleCheck Email Manager: http://www.doublecheckemail.com


--
To UNSUBSCRIBE, email to debian-cd-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org