Author: locilka Date: Mon Oct 6 14:52:44 2008 New Revision: 51866 URL: http://svn.opensuse.org/viewcvs/yast?rev=51866&view=rev Log: - Using PackagesProposal (`package/s, `pattern/s) to unify the software scenarios, desktops, and the rest of installation clients that can require to install some resolvables (bnc#432572) - 2.17.26 Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/modules/DefaultDesktop.ycp trunk/packager/src/modules/Packages.ycp trunk/packager/yast2-packager.spec.in Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=51866&r1=51865&r2=51866&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Mon Oct 6 14:52:44 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Oct 6 14:50:18 CEST 2008 - locilka@suse.cz + +- Using PackagesProposal (`package/s, `pattern/s) to unify the + software scenarios, desktops, and the rest of installation + clients that can require to install some resolvables (bnc#432572) +- 2.17.26 + +------------------------------------------------------------------- Fri Oct 3 16:45:29 CEST 2008 - lslezak@suse.cz - Fixed handling of services (bnc#427728) Modified: trunk/packager/src/modules/DefaultDesktop.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/DefaultDesktop.ycp?rev=51866&r1=51865&r2=51866&view=diff ============================================================================== --- trunk/packager/src/modules/DefaultDesktop.ycp (original) +++ trunk/packager/src/modules/DefaultDesktop.ycp Mon Oct 6 14:52:44 2008 @@ -16,6 +16,7 @@ import "ProductFeatures"; import "ProductControl"; import "Installation"; +import "PackagesProposal"; // All desktop definitions are taken from control file // @see GetAllDesktopsMap @@ -66,6 +67,8 @@ default_desktop = nil; desktop = default_desktop; + y2milestone ("Default desktop: '%1'", default_desktop); + // See BNC #424678 if (all_desktops == nil) { y2milestone ("Getting supported desktops from control file"); @@ -198,6 +201,8 @@ return desktop; } +string packages_proposal_ID = "DefaultDesktop"; + /** * Set the default desktop * @param desktop a string, one of "kde", "gnome", "min_x", "textmode" or nil @@ -205,10 +210,23 @@ global void SetDesktop (string new_desktop) { Init(); - if (new_desktop != nil && ! haskey (all_desktops, new_desktop)) + if (new_desktop != nil && ! haskey (all_desktops, new_desktop)) { y2error ("Attempting to set desktop to unknown %1", new_desktop); - else + } else if (desktop != new_desktop) { desktop = new_desktop; + + y2milestone ("New desktop has been set: %1", desktop); + + // Remove all already selected patterns + PackagesProposal::RemoveResolvables (packages_proposal_ID, `pattern, + PackagesProposal::GetResolvables (packages_proposal_ID, `pattern) + ); + + // Require new patterns + PackagesProposal::AddResolvables ( + packages_proposal_ID, `pattern, all_desktops[desktop,"patterns"]:[] + ); + } } /** Modified: trunk/packager/src/modules/Packages.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.ycp?rev=51866&r1=51865&r2=51866&view=diff ============================================================================== --- trunk/packager/src/modules/Packages.ycp (original) +++ trunk/packager/src/modules/Packages.ycp Mon Oct 6 14:52:44 2008 @@ -74,10 +74,6 @@ list<map> cached_proposal_selections = []; list<string> cached_proposal_languages = []; - // bnc #431251 - // patterns required by another parts of the installation - global list <string> required_patterns = []; - global boolean install_sources = false; // Installing source packages ? global integer timestamp = 0; // last time of getting the target map @@ -337,6 +333,7 @@ if (contains (flags, `desktop)) { // BNC #422077, Desktop doesn't need to be defined, e.g. in SLED + // BNC #431336 ... and even if it is defined, it needn't be visible string ddd = DefaultDesktop::Description(); if (ddd != "") { // installation proposal - SW summary, %1 is name of the selected desktop or system type (e.g. KDE) @@ -838,8 +835,11 @@ }); } + // FATE #302116 + // BNC #431580 + list <string> required_patterns = PackagesProposal::GetAllResolvables (`pattern); if (required_patterns != nil && required_patterns != []) { - y2milestone ("Patterns required by installation: %1", required_patterns); + y2milestone ("Patterns required by PackagesProposal: %1", required_patterns); pattern_list = (list <string>) merge (pattern_list, required_patterns); } @@ -1520,21 +1520,15 @@ */ void SelectSystemPatterns (boolean reselect) { list<string> system_patterns = ComputeSystemPatternList (); + // autoinstallation has patterns specified in the profile if (! Mode::autoinst ()) { system_patterns = (list<string>) - merge (system_patterns, DefaultDesktop::PatternsToSelect ()); - system_patterns = (list<string>) toset (merge (system_patterns, Product::patterns)); } if (! reselect) { - list<string> to_deselect = DefaultDesktop::PatternsToDeselect (); - y2milestone ("Deselecting system patterns %1", to_deselect); - foreach (string p, to_deselect, { - Pkg::ResolvableRemove (p, `pattern); - }); y2milestone ("Selecting system patterns %1", system_patterns); foreach (string p, system_patterns, { Pkg::ResolvableInstall (p, `pattern); @@ -1598,6 +1592,12 @@ * @return map for the API proposal */ global map Proposal (boolean force_reset, boolean reinit, boolean simple) { + // Reinit forced by application + if (full_repropose == true) { + y2milestone ("Forcing reinit"); + reinit = true; + full_repropose = false; + } // if the cache is valid and reset or reinitialization is not required // then the cached proposal can be used @@ -1683,7 +1683,6 @@ SelectSystemPackages (system_packages_selected && ! initial_run); SelectSystemPatterns (system_packages_selected && ! initial_run); system_packages_selected = true; - Pkg::PkgFreshen(); } else if (ProductFeatures::GetFeature ("software","selection_type") == `fixed) { Modified: trunk/packager/yast2-packager.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/yast2-packager.spec.in?rev=51866&r1=51865&r2=51866&view=diff ============================================================================== --- trunk/packager/yast2-packager.spec.in (original) +++ trunk/packager/yast2-packager.spec.in Mon Oct 6 14:52:44 2008 @@ -7,8 +7,8 @@ # HTTP.ycp BuildRequires: yast2-transfer -# PackagesProposal -BuildRequires: yast2 >= 2.17.36 +# PackagesProposal with `pattern(s) +Requires: yast2 >= 2.17.38 # "order" flag for pattern resolvables BuildRequires: yast2-pkg-bindings >= 2.17.13 @@ -19,8 +19,8 @@ # "order" flag for pattern resolvables Requires: yast2-pkg-bindings >= 2.17.13 -# PackagesProposal -Requires: yast2 >= 2.17.36 +# PackagesProposal with `pattern(s) +Requires: yast2 >= 2.17.38 # unzipping license file Requires: unzip -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org