[yast-devel] Language::language (and maybe other variables / functions)
Hi, As I've already written, I'm just trying to break some YaST*.rpm dependencies (See thread "[yast-devel] openSUSE 11.0 - Splitting YaST packages - Call for help"). I've found that there might be a candidate for moving some functionality (or only variable) to yast2.rpm or somewhere similarly. It is: +-------------------------------------------------+ | modules/Language.ycp, namely Language::language | +-------------------------------------------------+ These modules use Language YCP module: add-on autoinstallation firstboot installation metapackage network packager Language.ycp is part of yast2-country which directly uses (requires) these rpms: yast2 yast2-bootloader yast2-storage yast2-x11 I'm writing to the yast-devel mailing-list first before asking yast2-country maintainer to move Language::language (or more) somewhere else because I want to know where you think it is a good idea, whether it would help your modules at all ;) So, let me know, please :) Bye and Thanks! Lukas -- Lukas Ocilka, YaST Developer (xn--luk-gla45d) ----------------------------------------------------------------- SUSE LINUX, s. r. o., Lihovarska 1060/12, Praha 9, Czech Republic clients/release_notes_popup.ycp: string tmp = sformat (path_templ, Language::language); clients/release_notes_popup.ycp: tmp = sformat (path_templ, substring (Language::language, 0, 2)); clients/release_notes_popup.ycp: string tmp = sformat (path_templ, Language::language); clients/release_notes_popup.ycp: tmp = sformat (path_templ, substring (Language::language, 0, 2)); clients/inst_rpmcopy.ycp: Packages::SlideShowSetUp (Language::language); clients/inst_rpmcopy.ycp: Pkg::SetTextLocale (Language::language); clients/inst_rpmcopy.ycp: SlideShow::SetLanguage (Language::language); clients/yast_inf_finish.ycp: linuxrc["Language"] = Language::language; clients/inst_proposal.ycp: Pkg::SetLocale (Language::language); clients/inst_proposal.ycp: Pkg::SetAdditionalLocales ([Language::language]); clients/software_proposal.ycp: if (Pkg::GetPackageLocale () != Language::language) clients/software_proposal.ycp: Pkg::SetPackageLocale (Language::language); clients/software_proposal.ycp: if (! contains (Pkg::GetAdditionalLocales (), Language::language)) clients/software_proposal.ycp: add (Pkg::GetAdditionalLocales (), Language::language)); clients/inst_welcome.ycp:map welcome = CustomDialogs::load_file_locale(patterns,directory, Language::language); clients/language_auto.ycp: "language" : Language::language_on_entry, clients/language_auto.ycp: "languages" : Language::languages_on_entry, clients/language_auto.ycp: Console::SelectFont (Language::language); clients/language_proposal.ycp: string language_on_entry = Language::language; clients/language_proposal.ycp: (Language::languages == "" || Language::languages == language_on_entry) && clients/language_proposal.ycp: Language::languages = Misc::CustomSysconfigRead ("INSTALLED_LANGUAGES", "", clients/language_proposal.ycp: y2milestone ("languages got from target system: %1", Language::languages); clients/language_proposal.ycp: language_on_entry, Language::language, Language::languages); clients/language_proposal.ycp: if (force_reset && language_on_entry != Language::language) clients/language_proposal.ycp: "language_changed": (language_on_entry != Language::language ) clients/language_proposal.ycp: "language_changed": (language_on_entry != Language::language) clients/firstboot_language.ycp: string language_on_entry = Language::language; clients/firstboot_language.ycp: if( Language::language != language_on_entry || Language::ExpertSettingsChanged ) clients/language.ycp: splitstring (Language::languages, ",")); clients/language.ycp: y2milestone ("canceled -> restoring: %1", Language::language_on_entry); clients/language.ycp: Language::Set (Language::language_on_entry); clients/language.ycp: Console::SelectFont (Language::language); clients/language.ycp: Language::language, selection[Language::language,1]:"")); clients/language.ycp: string languages = Language::languages; clients/language.ycp: splitstring (languages, ","), ``(lang_code != Language::language)); clients/language.ycp: string language = options["lang"]:Language::language; clients/language.ycp: Language::languages = mergestring (llanguages, ","); clients/language.ycp: if (language != Language::language) clients/select_language.ycp: string language = Language::language; clients/select_language.ycp: list<string>languages = splitstring (Language::languages, ","); clients/select_language.ycp: // with the default selection according to Language::language clients/select_language.ycp: if (language != Language::language) clients/select_language.ycp: y2milestone ("Language changed from %1 to %2", Language::language, language); clients/select_language.ycp: Language::languages = clients/select_language.ycp: Language::languages = mergestring (selected_languages, ","); clients/inst_autoinit.ycp: Installation::encoding = Console::SelectFont( Language::language ); clients/inst_autoinit.ycp: UI::SetLanguage (Language::language, Installation::encoding); clients/inst_autoinit.ycp: WFM::SetLanguage (Language::language, "UTF-8"); clients/save_config_finish.ycp: string lang = Language::language; clients/inst_release_notes.ycp: Language::language, clients/inst_release_notes.ycp: substring (Language::language, 0, 2), clients/inst_productsources.ycp: language_long = Language::language; include/packager/load_release_notes.ycp: string tmp = sformat (path_templ, Language::language); include/packager/load_release_notes.ycp: tmp = sformat (path_templ, substring (Language::language, 0, 2)); include/installation/inst_inc_second.ycp: Pkg::SetLocale (Language::language); include/installation/inst_inc_second.ycp: string language = Language::language; include/installation/inst_inc_first.ycp: Installation::encoding = Console::SelectFont (Language::language); include/installation/inst_inc_first.ycp: UI::SetLanguage (Language::language, Installation::encoding); include/installation/inst_inc_first.ycp: WFM::SetLanguage (Language::language, "UTF-8"); modules/AutoinstClone.ycp: general["language"] = Language::language; modules/Timezone.ycp: string new_timezone = lang2tz[Language::language]:""; modules/Timezone.ycp: GetTimezoneForLanguage( Language::language, "US/Eastern"); modules/Timezone.ycp: * Uses Language::language for translation. modules/Packages.ycp: string language = Language::language; modules/Packages.ycp: list<string> locales = LocaleVersions (Language::language); modules/Packages.ycp: Pkg::SetTextLocale (Language::language); modules/Packages.ycp: force_reset, reinit, Language::language); modules/Packages.ycp: Pkg::SetAdditionalLocales ([Language::language]); modules/Keyboard.ycp: * Uses Language::language for translation. modules/Keyboard.ycp: default_keyboard = GetKeyboardForLanguage( Language::language, "english-us" ); modules/Keyboard.ycp: GetKeyboardForLanguage ( Language::language, "english-us" ); modules/ProductLicense.ycp: Language::language, modules/ProductLicense.ycp: substring (Language::language, 0, 2), // "it_IT" -> "it" modules/ProductLicense.ycp: y2milestone ("Preffered lang: %1", Language::language); modules/SlideShow.ycp: global string language = Language::language; modules/OneClickInstall.ycp: summary = YPX::SelectValue(xml,"/metapackage/group[@distversion='" + Product::name + "']/summary[@lang='" + Language::language + "']"); modules/OneClickInstall.ycp: summary = YPX::SelectValue(xml,"/metapackage/group[not(@distversion)]/summary[@lang='" + Language::language + "']"); modules/OneClickInstall.ycp: description = YPX::SelectValue(xml,"/metapackage/group[@distversion='" + Product::name + "']/description[@lang='" + Language::language + "']"); modules/OneClickInstall.ycp: description = YPX::SelectValue(xml,"/metapackage/group[not(@distversion)]/description[@lang='" + Language::language + "']"); modules/OneClickInstall.ycp: string summary = YPX::SelectValue(xml,THIS_REPO_XPATH + "summary[@lang='"+ Language::language +"']"); modules/OneClickInstall.ycp: string description = YPX::SelectValue(xml,THIS_REPO_XPATH + "description[@lang='"+ Language::language +"']"); modules/OneClickInstall.ycp: string summary = YPX::SelectValue(xml,THIS_SOFTWARE_XPATH + "summary[@lang='"+ Language::language +"']"); modules/OneClickInstall.ycp: string description = YPX::SelectValue(xml,THIS_SOFTWARE_XPATH + "description[@lang='"+ Language::language +"']");
Hi!
These modules use Language YCP module: add-on autoinstallation firstboot installation metapackage network packager
I'm one half of y2-network team, so I'll speak on yast2-network package only. The only place where any language-related function is of any use are DSL or Modem modules respectively, where (according to your locale) YaST tries to propose suitable ISP to you. Thus, in y2-network: * /usr/share/YaST/data/country.ycp file is read (maps country codes to country names) * GetLanguageCountry() function is called (maps locale to country code e.g. cs_CZ.UTF-8 -> CZ) The same basically holds true for yast2-ntp-client, which also depends on yast2-country, only in order to propose suitable set of public NTP servers based on current locale. It reads country.ycp file as well, moreover, it duplicates much GetLanguageCountry code within itself ;-)
I'm writing to the yast-devel mailing-list first before asking yast2-country maintainer to move Language::language (or more) somewhere else because I want to know where you think it is a good idea, whether it would help your modules at all ;)
Definitely, it's a good idea. Moreover, the above mentioned function and country.ycp data file are another suitable candidates for the move (killing two birds with one stone - breaking y2-network and y2-ntp-client's dependency on y2-country) B. -- \\\\\ Katarina Machalkova \\\\\\\__o YaST developer __\\\\\\\'/_ & hedgehog painter
Hi hackers, from version 2.16.3 is yast2-country splitted into 2 packages, the new one is yast2-country-data, including language data files AND the module Language.ycp. This means that all of you who want to use any function from Language.ycp (especially the variable Language::language) can depend your packages only on lightweighted module yast2-country-data (*) instead of yast2-country. Additionally, those who need to use only country.ycp or country_long.ycp (without any other yast2-country API) could just remove their dependency on yast2-country as these two files were moved to yast2.rpm, starting with version 2.16.17. Jiri (*) There are 2 reasons for not putting Language,ycp + 52 data files directly into yast2.rpm: 1) most users wouldn't need it there so it is not necessary to make the package even bigger and 2) it is easier for me to maintain the files when they are under one place (trunk/country) in SVN. -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Jiří Suchomel wrote:
Hi hackers, from version 2.16.3 is yast2-country splitted into 2 packages, the new one is yast2-country-data, including language data files AND the module Language.ycp. This means that all of you who want to use any function from Language.ycp (especially the variable Language::language) can depend your packages only on lightweighted module yast2-country-data (*) instead of yast2-country.
Additionally, those who need to use only country.ycp or country_long.ycp (without any other yast2-country API) could just remove their dependency on yast2-country as these two files were moved to yast2.rpm, starting with version 2.16.17.
Hi, Thanks, I've already changed installation and packager to use yast2-country-data instead of yast2-country. Please, when moving some stuff from one package to another, don't forget to adjust RPM dependencies (Requires, BuildRequires, Conflicts) in both packages. Example: File "f" has been moved from package "A" (version "X") to package "B" (version "Y"). Spec file for package "A": if (A requires B) { Requires: B >= Y } else { Conflicts: B < Y } if (Needed during build time) { BuildRequires: B >= Y } Spec file for package "B": if (B requires A) { Requires: A >= X } else { Conflicts: A < X } if (Needed during build time) { BuildRequires: A >= X } I hope the example is correct :) Anyway, you know what I mean if it isn't ;)
(*) There are 2 reasons for not putting Language,ycp + 52 data files directly into yast2.rpm: 1) most users wouldn't need it there so it is not necessary to make the package even bigger and 2) it is easier for me to maintain the files when they are under one place (trunk/country) in SVN.
Even if the yast2-country-data will be probably installed in every system (requested by packager, installation), it's worth having the data separately. Have a nice day Bye Lukas
On čt 1. listopadu 2007, Lukas Ocilka wrote:
Hi, ... These modules use Language YCP module: add-on autoinstallation firstboot installation metapackage network packager
First, I'm definitely not against moving whole Language.ycp or some its part to yast2.rpm (if it is possible - I would prefer not moving the data files). It could be good that other modules don't need to require yast2-country. However, don't be so scared by this:
Language.ycp is part of yast2-country which directly uses (requires) these rpms: yast2 yast2-bootloader yast2-storage yast2-x11
is not entirely true: - functions from yast2-x11 are used only when the package is installed. There's no requirement. - API of yast2-storage is used only during installation, therefore it is not in the list of requires (but it's probably coded wrongly in timezone/src/dialogs.ycp: the import of Storage should be moved into some client to ensure it is not imported when yast2-storage is not installed) Looking at the dependency on yast2-bootloader, language.ycp uses only GfxMenu::Update call. AFAICS GfxMenu.ycp doesn't use anything special from yast2-bootloader except the sysconfig agent definitions, so maybe this one (together with cfg_bootloader.scr and cfg_bootsplash.scr) could be moved to yast2.rpm as well? j -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Dne Friday 09 of November 2007 10:51:10 Jiří Suchomel napsal(a):
On čt 1. listopadu 2007, Lukas Ocilka wrote:
Hi, ... These modules use Language YCP module: add-on autoinstallation firstboot installation metapackage network packager
First, I'm definitely not against moving whole Language.ycp or some its part to yast2.rpm (if it is possible - I would prefer not moving the data files).
It could be good that other modules don't need to require yast2-country.
However, don't be so scared by this:
Language.ycp is part of yast2-country which directly uses (requires) these rpms: yast2 yast2-bootloader yast2-storage yast2-x11
is not entirely true:
- functions from yast2-x11 are used only when the package is installed. There's no requirement.
- API of yast2-storage is used only during installation, therefore it is not in the list of requires (but it's probably coded wrongly in timezone/src/dialogs.ycp: the import of Storage should be moved into some client to ensure it is not imported when yast2-storage is not installed)
Looking at the dependency on yast2-bootloader, language.ycp uses only GfxMenu::Update call. AFAICS GfxMenu.ycp doesn't use anything special from yast2-bootloader except the sysconfig agent definitions, so maybe this one (together with cfg_bootloader.scr and cfg_bootsplash.scr) could be moved to yast2.rpm as well?
Well, GfxMenu is there to regenerate the bootloader menu (to contain translations for the new languages). After this is done, the rest depends on the bootloader: In case of GRUB, that's it, in case of LILO it has to call /sbin/lilo. Clean solution would be to make it depend on perl-Bootloader, however, currently it is solved by a hack and /sbin/lilo is called directly. So, yes, this may be an option. Jiri -- Regards, Jiri Srain YaST Team Leader --------------------------------------------------------------------- SUSE LINUX, s.r.o. e-mail: jsrain@suse.cz Lihovarska 1060/12 tel: +420 284 028 959 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz
participants (4)
-
Jiri Srain
-
Jiří Suchomel
-
Katarina Machalkova
-
Lukas Ocilka