[yast-commit] r67543 - in /branches/SuSE-Code-11-SP1-Branch/bootloader: VERSION package/yast2-bootloader.changes src/generic/sections_widget.ycp src/generic/wizards.ycp
Author: snwint Date: Fri Feb 24 16:41:12 2012 New Revision: 67543 URL: http://svn.opensuse.org/viewcvs/yast?rev=67543&view=rev Log: - track section renaming properly in zipl menu (bnc #740324) - 2.17.87 Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/sections_widget.ycp branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/wizards.ycp Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION?rev=67543&r1=67542&r2=67543&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION Fri Feb 24 16:41:12 2012 @@ -1 +1 @@ -2.17.86 +2.17.87 Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes?rev=67543&r1=67542&r2=67543&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes Fri Feb 24 16:41:12 2012 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Feb 24 16:34:16 CET 2012 - snwint@suse.de + +- track section renaming properly in zipl menu (bnc #740324) +- 2.17.87 + +------------------------------------------------------------------- Fri Jan 27 14:58:43 CET 2012 - snwint@suse.de - fix default menu entry detection (bnc #740324) Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/sections_widget.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/sections_widget.ycp?rev=67543&r1=67542&r2=67543&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/sections_widget.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/sections_widget.ycp Fri Feb 24 16:41:12 2012 @@ -172,6 +172,9 @@ BootCommon::current_section = selected; BootCommon::current_section_index = op == `add ? -1 : index; BootCommon::current_section_name = name; + // we need the old name to keep the zipl menu in sync (bnc #740324) + // see fixZiplMenu() + BootCommon::current_section["old_name"] = name; y2internal ("Selected section: %1", BootCommon::current_section); if (BootCommon::current_section["name"]:"" == BootCommon::globals["default"]:"") Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/wizards.ycp?rev=67543&r1=67542&r2=67543&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/wizards.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/generic/wizards.ycp Fri Feb 24 16:41:12 2012 @@ -25,6 +25,32 @@ import "CWMTab"; +// bnc #740324 +// When a section is renamed, update the section name list in the zipl menu, too. +// +void fixZiplMenu(string old_name, string new_name) +{ + if (old_name != "" && new_name != "" && old_name != new_name && BootCommon::getLoaderType (false) == "zipl") + { + y2milestone("fixZiplMenu: rename section: %1 -> %2", old_name, new_name); + + BootCommon::sections = maplist (map<string,any> section, BootCommon::sections, + { + if (section["type"]:"" == "menu" && haskey(section, "list")) + { + string l = regexpsub(section["list"]:"", "^(|.*, )" + old_name + "(|,.*)$", "\\1" + new_name + "\\2"); + + if(l != nil) { section["list"] = l; } + + y2milestone("fixZiplMenu: updated menu list = %1", section["list"]:""); + } + + return section; + }); + } +} + + // calculate the list of available section types list<string> section_types () { list<string> st_list = []; @@ -103,9 +129,12 @@ symbol GenericStoreSection () { BootCommon::current_section["__changed"] = true; - y2debug ("Storing section: index: %1, contents: %2", + y2milestone ("Storing section: index: %1, contents: %2", BootCommon::current_section_index, BootCommon::current_section); + + fixZiplMenu(BootCommon::current_section["old_name"]:"", BootCommon::current_section["name"]:""); + if (BootCommon::current_section_index == -1) { BootCommon::sections -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
snwint@svn2.opensuse.org