[yast-commit] r46903 - in /trunk/packager: package/yast2-packager.changes src/modules/DefaultDesktop.ycp
Author: locilka Date: Mon Apr 21 14:16:58 2008 New Revision: 46903 URL: http://svn.opensuse.org/viewcvs/yast?rev=46903&view=rev Log: - Added new function DefaultDesktop::SelectedDesktops() to list all installed desktops or desktop selected for installation (bnc #380774). Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/modules/DefaultDesktop.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=46903&r1=46902&r2=46903&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Mon Apr 21 14:16:58 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Apr 21 14:17:55 CEST 2008 - locilka@suse.cz + +- Added new function DefaultDesktop::SelectedDesktops() to list all + installed desktops or desktop selected for installation + (bnc #380774). + +------------------------------------------------------------------- Fri Apr 18 15:37:30 CEST 2008 - locilka@suse.cz - Do not overwrite passwd and shadow files if they already exist on Modified: trunk/packager/src/modules/DefaultDesktop.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/DefaultDesktop.ycp?rev=46903&r1=46902&r2=46903&view=diff ============================================================================== --- trunk/packager/src/modules/DefaultDesktop.ycp (original) +++ trunk/packager/src/modules/DefaultDesktop.ycp Mon Apr 21 14:16:58 2008 @@ -13,7 +13,7 @@ textdomain "packager"; import "ProductFeatures"; - +import "Installation"; // Could be defined in control file // @see GetAllDesktopsMap @@ -82,6 +82,47 @@ } /** + * Return list installed desktops or desktop selected for installation. + * + * @see GetAllDesktopsMap + */ +global list <string> SelectedDesktops () { + Pkg::TargetInit (Installation::destdir, true); + Pkg::SourceStartManager (true); + Pkg::PkgSolve (true); + + list <string> all_sel_or_inst_patterns = maplist (map <string, any> one_pattern, Pkg::ResolvableProperties ("", `pattern, ""), { + if (one_pattern["status"]:`unknown == `selected || one_pattern["status"]:`unknown == `installed) { + return one_pattern["name"]:""; + } + }); + + // all selected or installed patterns + all_sel_or_inst_patterns = filter (string one_pattern, all_sel_or_inst_patterns, { + return (one_pattern != nil); + }); + + list <string> selected_desktops = []; + boolean selected = true; + + foreach (string desktop_name, map desktop_def, all_desktops, { + selected = true; + + foreach (string one_pattern, desktop_def["patterns"]:[], { + if (! contains (all_sel_or_inst_patterns, one_pattern)) { + selected = false; + return; + } + }); + + if (selected) + selected_desktops = add (selected_desktops, desktop_name); + }); + + return selected_desktops; +} + +/** * Desktop which was selected in the desktop selection dialog * "kde", "gnome", "min_x11", "text" */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org