Author: lslezak Date: Mon Nov 8 17:09:36 2010 New Revision: 62766 URL: http://svn.opensuse.org/viewcvs/yast?rev=62766&view=rev Log: - don't install recommended packages for already installed packages when adding a new language (bnc#439373) - start the package manager when there are unresolved dependencies - 2.20.3 Modified: trunk/country/VERSION trunk/country/language/src/language.ycp trunk/country/language/src/modules/Language.ycp trunk/country/language/src/select_language.ycp trunk/country/package/yast2-country.changes Modified: trunk/country/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/VERSION?rev=62766&r1=62765&r2=62766&view=diff ============================================================================== --- trunk/country/VERSION (original) +++ trunk/country/VERSION Mon Nov 8 17:09:36 2010 @@ -1 +1 @@ -2.20.2 +2.20.3 Modified: trunk/country/language/src/language.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/language.ycp?rev=62766&r1=62765&r2=62766&view=diff ============================================================================== --- trunk/country/language/src/language.ycp (original) +++ trunk/country/language/src/language.ycp Mon Nov 8 17:09:36 2010 @@ -74,16 +74,20 @@ Progress::NextStage (); boolean enough_space = true; + boolean solved = true; if (Language::PackagesModified () && !no_packages) { if (Mode::commandline ()) { // if not commandline, packages were already initialized in // select_language - enough_space = Language::PackagesInit ( + solved = Language::PackagesInit ( splitstring (Language::languages, ",")); + enough_space = Language::EnoughSpace(); + + y2milestone("Packages solved: %1, enough space; %2", solved, enough_space); } - if (enough_space) + if (enough_space && solved) { Language::PackagesCommit (); } Modified: trunk/country/language/src/modules/Language.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/modules/Language.ycp?rev=62766&r1=62765&r2=62766&view=diff ============================================================================== --- trunk/country/language/src/modules/Language.ycp (original) +++ trunk/country/language/src/modules/Language.ycp Mon Nov 8 17:09:36 2010 @@ -889,20 +889,68 @@ y2milestone ("Saved data for language: <%1>", loc); } +boolean reset_recommended = true; + +// unselect all selected packages (bnc#439373) +// +// this is a workaround for installing recommened packages for already +// installed packages - we cannot simply set the solver flag +// as the laguage packages are also recommended, this would cause that +// no language package would be installed +// +// do this just once at the beginning +void ResetRecommendedPackaged() +{ + if (!reset_recommended) + { + return; + } + + Pkg::PkgSolve(true); + + list<map> selected_packages = Pkg::ResolvableProperties("", `package, ""); + + y2milestone("Unselecting already recommended packages"); + + // unselect them + foreach(map package, selected_packages, + { + if (package["status"]:`unknown == `selected) + { + y2milestone("Unselecting package: %1", package["name"]:""); + Pkg::PkgNeutral(package["name"]:""); + } + } + ); + + reset_recommended = false; +} + /** * Initializes source and target, * computes the packages necessary to install and uninstall, - * checks for disk space (#50745) - * @return false when there is not enough disk space for new packages + * @return false if the solver failed (unresolved dependencies) */ global define boolean PackagesInit (list<string> selected_languages) { PackageSystem::EnsureSourceInit (); PackageSystem::EnsureTargetInit (); + ResetRecommendedPackaged(); + Pkg::SetAdditionalLocales (selected_languages); - Pkg::PkgSolve (true); + boolean solved = Pkg::PkgSolve (true); + + return solved; +} + +/* + * checks for disk space (#50745) + * @return false when there is not enough disk space for new packages + */ +global define boolean EnoughSpace() +{ boolean ok = true; foreach (string mountpoint, list<integer> usage, Pkg::TargetGetDU (), { if (usage[2]:0 > usage[0]:0) Modified: trunk/country/language/src/select_language.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/select_language.ycp?rev=62766&r1=62765&r2=62766&view=diff ============================================================================== --- trunk/country/language/src/select_language.ycp (original) +++ trunk/country/language/src/select_language.ycp Mon Nov 8 17:09:36 2010 @@ -35,6 +35,7 @@ import "Stage"; import "Timezone"; import "Wizard"; + import "PackagesUI"; string language = Language::language; @@ -619,7 +620,22 @@ } else if (Language::PackagesModified () && !Mode::config ()) { - if (!Language::PackagesInit (selected_languages)) + if (!Language::PackagesInit(selected_languages)) + { + // error message - package solver failed + Report::Error (_("There are unresolved package dependencies.")); + + // run the package selector + + // disable repomanagement during installation + boolean repomgmt = !Mode::installation(); + // start the package selector + PackagesUI::RunPackageSelector($[ "enable_repo_mgr" : repomgmt, "mode" : `summaryMode ]); + + ret = `not_next; + continue; + } + if (!Language::EnoughSpace()) { // error message Report::Error (_("There is not enough space to install all additional packages. Modified: trunk/country/package/yast2-country.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/yast2-country.changes?rev=62766&r1=62765&r2=62766&view=diff ============================================================================== --- trunk/country/package/yast2-country.changes (original) +++ trunk/country/package/yast2-country.changes Mon Nov 8 17:09:36 2010 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Nov 8 14:24:53 UTC 2010 - lslezak@suse.cz + +- don't install recommended packages for already installed packages + when adding a new language (bnc#439373) +- start the package manager when there are unresolved dependencies +- 2.20.3 + +------------------------------------------------------------------- Tue Oct 19 14:41:32 CEST 2010 - jsuchome@suse.cz - Easter Island is in Pacific (bnc#647562) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org