Gentoo Archives: gentoo-portage-dev

From: Marius Mauch <genone@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] --config-root command-line option
Date: Fri, 17 Nov 2006 07:48:00
Message-Id: 20061117085502.6cd4f071.genone@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] --config-root command-line option by Zac Medico
1 On Thu, 16 Nov 2006 15:43:48 -0800
2 Zac Medico <zmedico@g.o> wrote:
3
4 > -----BEGIN PGP SIGNED MESSAGE-----
5 > Hash: SHA1
6 >
7 > Marius Mauch wrote:
8 > > On Thu, 16 Nov 2006 09:33:05 -0800
9 > > Zac Medico <zmedico@g.o> wrote:
10 > >
11 > >> Sure, that's one way to solve that particular problem. However, I feel
12 > >> that command line options are more aesthetically appealing than environment
13 > >> variables (maybe it's just me).
14 > >>
15 > >> Zac
16 > >
17 > > It's just you ;)
18 > >
19 > > Marius
20 >
21 > Do you honestly prefer environment variables over command line options? I
22 > prefer command line options because they are part of a clearly defined
23 > interface. With environment variables, the interface may not be clearly
24 > defined and it's easy for variables to accidentally leak in, affecting
25 > internals in unexpected ways.
26 >
27 > Zac
28
29 I prefer to have one way to do things, and the system for variables worked quite well so far. Adding CLI overrides on top of that seems not only redundant to me but also potentially confusing (which vars have CLI overrides? where in the incremental stack does the override fit in?). Add that to the already overloaded option system.
30 Besides, if you need this feature on a somewhat regular base it seems easier to me to just export the var once instead of specifying the option on the command line all the time (ok, using DEFAULT_OPTS avoids that, but then you have the same issues you listed above).
31 And last but not least a CLI option is bound to emerge, but this feature can also be useful for other tools. Checking an env var in the config class would enable it implicitly for all users of portage.py, without it everyone would have to basically duplicate the relevant code from emerge.
32 I'm not generally against using CLI options for passing in arguments, but in this case I think it's wrong.
33
34 Marius
35 --
36 gentoo-portage-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-portage-dev] [PATCH] --config-root command-line option Zac Medico <zmedico@g.o>
Re: [gentoo-portage-dev] [PATCH] --config-root command-line option Daniel Barkalow <barkalow@××××××××.org>