Bug 131745

Summary: Add support for installing multiple languages to AutoYAST
Product: [openSUSE] SUSE LINUX 10.0 Reporter: T. Ribbrock <argathin>
Component: AutoYaSTAssignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: jsuchome, ug
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch for general_dialogs.ycp

Description T. Ribbrock 2005-11-01 12:53:42 UTC
Currently, it is not possible to create an automatic installation with AutoYAST that will install several languages during install (i.e. install all relevant packages for the selected languages/package combinations, like the YaST2 Language GUI does with "Secondary Languages"). For multilingual environments, adding this functionality would greatly increase the ease of an autoinstallation, as it would no longer be necessary to manually find all relevant packages that need to be added.
Comment 1 Jiří Suchomel 2005-11-01 13:15:03 UTC
Uwe, I'm assigning this to me, but I want to hear your opinion if we want to have this in 10.1
Comment 2 Jiří Suchomel 2005-11-03 13:25:49 UTC
(13:46:30) jsuchome:  current content of country _auto clients is just the "Change" function
(13:47:05) jsuchome:  which others do you need? Summary + Write? More?
(13:47:20) ug:  Read() for cloning
(13:47:30) ug:  Export() for cloning too
(13:48:16) ug:  Import() of course to feed the profile stuff into the client
(13:48:42) ug:  during the installation
(13:49:09) ug:  so it's Import()+Write() for the installation process
(13:49:23) ug:  and Read()+Export() to make the module cloneable
Comment 3 Jiří Suchomel 2005-11-07 10:17:25 UTC
yast2-country in svn now supports common autoayast API; now autoyast has to use it
Comment 4 Jiří Suchomel 2005-11-07 10:20:56 UTC
Created attachment 56576 [details]
patch for general_dialogs.ycp

basic patch, enabling start of auto clients from country
Comment 5 Jiří Suchomel 2005-11-07 14:29:23 UTC
Michael, Pkg::SetAdditionalLocales doesn't work for autoyast config mode. How could I use it to achieve that?
Comment 6 Jiří Suchomel 2005-11-10 12:26:05 UTC
OK, when it would be difficult to do new function in Pkg to suport such functionality (ma) and if it is ok fromautoyast side to add new packages during installation and not during config phase (ug), I'll do it this way:

- add a Pkg::SetAdditionalLocales call to "Write" function and remove it from UI part ("Change" function).
Comment 7 Jiří Suchomel 2005-11-11 07:52:42 UTC
Well, one more question to Michael and/or Uwe:

during autoinstallation (= "Write" call of language_auto), is it sufficient to call Pkg::SetAdditionalLocales (and relay on the fact that Pkg is already initialized and all packages will be commited+installed later in some common call) or do I need to run the whole

PackageSystem::EnsureSourceInit ();
PackageSystem::EnsureTargetInit ();
Pkg::SetAdditionalLocales (selected_languages);
Pkg::PkgSolve (true);
PackageCallbacksInit::InitPackageCallbacks ();
Pkg::PkgCommit (0);

sequence?

Uwe: is there any common way to install packages during autoinstallation (e.g. _after_ the Write functions of all clients are written)?

Michael: is it ok to call whole sequence above even if everything is already intialized or if it would be initialized again later?
Comment 8 Uwe Gansert 2005-11-11 11:09:14 UTC
> is there any common way to install packages during autoinstallation (e.g.
> _after_ the Write functions of all clients are written)?

no but why do you need that?
I'm not an expert of the interaction between the language and the software module but I'll explain here how I think it should work.

In the first stage (before the first reboot), autoyast will call Import() (and Write() if you need that) of the language_auto client. That's an exception to all other *_auto clients who will be called _after_ the first reboot - I know of that exception but I can live with that because the langage module _is_ a little bit different and so it's necessary. If I understand you right, then you don't like to see that exception? We can try to circumvent that step and to install the language dependent packages _after_ the first reboot but that'll make it way more complex and I already see problems that we get if we go that way.
So, after autoyast has fed the language_auto client via Import the language_auto client then sets the additional languages in the package manager so that it knows the selections and can install the additionaly needed packages.
Then the first reboot happens and the language_auto client will be called again (Import() and Write()), like all other *_auto clients are. Of course no language dependent packages needs to be installed now because they already are installed but maybe some sysconfig variables must be written.

Jiri, do you see it the same way? Do you see problem that I might have overlooked?

Comment 9 Jiří Suchomel 2005-11-14 09:52:30 UTC
The only think I'm trying to do is doing the language configuration the standard way (at least as much as possible). I was asking when the other clients do install the packages? In which stage?

I personally think that the packages whould be installed from the Write function, I do not have any requirement that it has to be called in 1st or 2nd stage.

And I was specifically asking if there is any point during autoinstallation, where we can rely on that now there are some packages installed. Well, this is because the installation of packages from language module is done kind of specific way - the language module does not provide list of packages, but the Pkg interface does it. Ususally, langauge call a bunch of functions described in comment #7, but this might not be necessary. For example it does not have to call  EnsureSourceInit, EnsureTargetInit if the source (resp. target) is already initialized. It doesn't have to call Pkg::PkgCommit, if some Commit call would be called sometimes later - that's why I'm asking if there is some time when such or similar functions are called.

But maybe I'm trying to optimize it too much. Of course language client can call all the necessary functions (let's say in "Write") even if they would be called earliear/later. That's why I set this to NEEDINFO for Michael: I'm not sure if it wouldn't break anything if I put the whole block of these functions inside some other block of similar functions (e.g. the initialization was already done before language and solving is done after it).
Comment 10 Uwe Gansert 2005-11-14 10:02:05 UTC
> I was asking when the other
> clients do install the packages? In which stage?

after the first reboot. All *_auto clients are called to tell autoyast which packages they need. Autoyast then installs them.

Comment 11 Jiří Suchomel 2005-11-14 10:09:52 UTC
well, current AutoinstSoftware installs the packages required by language module (at line 343) - but using "additional_locales" value, which might not be set. If it is replaced by the list got from splitstring (Language::languages, ","), it should work.
Comment 12 Uwe Gansert 2005-11-14 10:23:01 UTC
> well, current AutoinstSoftware installs the packages required by language
> module (at line 343)

I overlooked that. My idea is that those lines will be dropped, because it's done in your language_auto client which is called before.

Comment 13 Jiří Suchomel 2005-11-14 10:30:53 UTC
Maybe I could add just a lone call of Pkg::SetAdditionalLocales to (new) "Packages" function of language_auto. AutoinstSoftware::Write should do the rest - it already does PkgSolve, but I'm not sure, where the packages got from solver are actually installed.
Comment 14 Jiří Suchomel 2005-11-15 11:58:46 UTC
Fixed in yast2-country-2.13.7. Pkg::SetAdditionalLocales is called at the end of Import function in case of Mode::autoinst