On Tue, 22 Jul 2014, Jiri Srain wrote:

There is a single variable which stores the mode. All the rest are just wrappers comparing this variable to a particular value (or values). Therefore you definitely cannot have 2^7 modes. (*)

The confusion here is IMO the result of conversion from YCP; if the code used ruby naming conventions, Mode.update would definitely be called Mode.update?

   # we're doing an update
   def update
     mode == "update" || mode == "autoupgrade"
   end


(*) OK, there is one variable for general mode, one variable for testing mode (which should IMO be squeezed out as a next step after switch to Ruby) and one variable for UI mode - but still not 3^7 different modes :-)

Ok, looking at the actual Mode implementation sheds some light on this.
I'd prefer not having to do this for every class, though. :-/

So there are 8 generic 'modes' and some test functions combining these.
Roughly along the lines I guessed in my post.

Some issues:

1) the active mode is not logged; at least not during the usual install
workflow because Initialize() doesn't use SetMode() to set the mode;
SetTest() and SetUI() don't even bother

2) it's really anyone's guess why Mode.update combines update and autoupgrade 
while
Mode.autoinst does not combine autoinstallation and autoupgrade

3) there actually 3 mode categories: workflow modes, test modes, and ui modes...


Steffen
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to