Author: locilka Date: Tue Apr 8 19:46:24 2008 New Revision: 46259 URL: http://svn.opensuse.org/viewcvs/yast?rev=46259&view=rev Log: - Adjusted control file to sort installation overview via presentation_order and propose it via the real appearance. - Fixed selecting the right imageset - the rule is currently that all patterns in imageset must be selected for installation (bnc #378032). Modified: trunk/installation/control/control.openSUSE.xml trunk/installation/package/yast2-installation.changes trunk/installation/src/modules/ImageInstallation.ycp Modified: trunk/installation/control/control.openSUSE.xml URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/control/control.open... ============================================================================== --- trunk/installation/control/control.openSUSE.xml (original) +++ trunk/installation/control/control.openSUSE.xml Tue Apr 8 19:46:24 2008 @@ -123,16 +123,44 @@ <name>initial</name> <enable_skip>no</enable_skip> <proposal_modules config:type="list"> - <proposal_module>mouse</proposal_module> - <proposal_module>partitions</proposal_module> - <proposal_module>bootloader</proposal_module> - <proposal_module>software</proposal_module> - <proposal_module>country_simple</proposal_module> - <proposal_module>timezone</proposal_module> - <!-- FATE #302980 --> - <proposal_module>users</proposal_module> - <proposal_module>runlevel</proposal_module> - <proposal_module>hwinfo</proposal_module> + <proposal_module> + <name>partitions</name> + <presentation_order>10</presentation_order> + </proposal_module> + <proposal_module> + <name>bootloader</name> + <presentation_order>20</presentation_order> + </proposal_module> + <proposal_module> + <name>country_simple</name> + <presentation_order>40</presentation_order> + </proposal_module> + <proposal_module> + <name>timezone</name> + <presentation_order>50</presentation_order> + </proposal_module> + <!-- FATE #302980 --> + <proposal_module> + <name>users</name> + <presentation_order>60</presentation_order> + </proposal_module> + <proposal_module> + <name>runlevel</name> + <presentation_order>70</presentation_order> + </proposal_module> + <proposal_module> + <name>hwinfo</name> + <presentation_order>80</presentation_order> + </proposal_module> + <proposal_module> + <name>mouse</name> + <presentation_order>90</presentation_order> + </proposal_module> + <!-- software proposal should be computed at the end --> + <proposal_module> + <name>software</name> + <presentation_order>30</presentation_order> + </proposal_module> </proposal_modules> <!-- <proposal_tabs config:type="list"> Modified: trunk/installation/package/yast2-installation.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-instal... ============================================================================== --- trunk/installation/package/yast2-installation.changes (original) +++ trunk/installation/package/yast2-installation.changes Tue Apr 8 19:46:24 2008 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Tue Apr 8 19:40:58 CEST 2008 - locilka@suse.cz + +- Adjusted control file to sort installation overview via + presentation_order and propose it via the real appearance. +- Fixed selecting the right imageset - the rule is currently that + all patterns in imageset must be selected for installation + (bnc #378032). + +------------------------------------------------------------------- Mon Apr 7 15:20:14 CEST 2008 - locilka@suse.cz - Added new control file entry kexec_reboot that defines whether Modified: trunk/installation/src/modules/ImageInstallation.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/modules/ImageIns... ============================================================================== --- trunk/installation/src/modules/ImageInstallation.ycp (original) +++ trunk/installation/src/modules/ImageInstallation.ycp Tue Apr 8 19:46:24 2008 @@ -327,6 +327,17 @@ return ret; } +boolean EnoughPatternsMatching (integer matching_patterns, integer patterns_in_imagesets) { + if (matching_patterns == nil || matching_patterns < 0) + return false; + + if (patterns_in_imagesets == nil || patterns_in_imagesets < 0) + return false; + + // it's actually matching_patterns = patterns_in_imagesets + return (matching_patterns >= patterns_in_imagesets); +} + /** * Find a set of images which suites selected patterns * @param patterns a list of patterns which are selected @@ -357,19 +368,21 @@ } list<map<string,any> > image_sets = image_descr["image_sets"]:[]; - y2milestone ("Image set descriptions: %1", image_sets); + y2debug ("Image set descriptions: %1", image_sets); map<string,any> result = $[]; // more patterns could match at once // as we can't merge the meta image, only one can be selected map <string, map <string, any> > possible_patterns = $[]; map <string, integer> matching_patterns = $[]; + map <string, integer> patterns_in_imagesets = $[]; // trying to find all matching patterns foreach (map<string,any> image, image_sets, { string pattern = image["patterns"]:""; list <string> imageset_patterns = splitstring (pattern, ", "); + patterns_in_imagesets[pattern] = size (imageset_patterns); // no image-pattern defined, matches all patterns if (size (imageset_patterns) == 0) { @@ -384,7 +397,7 @@ } }); - y2milestone ("Matching patterns: %1, sizes: %2", possible_patterns, matching_patterns); + y2debug ("Matching patterns: %1, sizes: %2", possible_patterns, matching_patterns); string last_pattern = ""; @@ -393,7 +406,13 @@ last_pattern = ""; foreach (string pattern, map <string, any> image, possible_patterns, { - if (matching_patterns[pattern]:0 > last_number_of_matching_patterns) { + if ( + // imageset matches more patterns than the currently best-one + matching_patterns[pattern]:0 > last_number_of_matching_patterns + && + // enough patterns matches the selected imageset + EnoughPatternsMatching (matching_patterns[pattern]:0, patterns_in_imagesets[pattern]:0) + ) { last_number_of_matching_patterns = matching_patterns[pattern]:0; result = image; last_pattern = pattern; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org