Author: locilka Date: Fri Jan 16 12:39:35 2009 New Revision: 54686 URL: http://svn.opensuse.org/viewcvs/yast?rev=54686&view=rev Log: - Fixed Automatic Backup for profiles with a space character in the profile name (bnc #466750). - 2.17.5 Modified: branches/SuSE-Code-11-Branch/backup/VERSION branches/SuSE-Code-11-Branch/backup/package/yast2-backup.changes branches/SuSE-Code-11-Branch/backup/src/functions.ycp branches/SuSE-Code-11-Branch/backup/src/scripts/backup_cron branches/SuSE-Code-11-Branch/backup/src/ui.ycp Modified: branches/SuSE-Code-11-Branch/backup/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/backup/VER... ============================================================================== --- branches/SuSE-Code-11-Branch/backup/VERSION (original) +++ branches/SuSE-Code-11-Branch/backup/VERSION Fri Jan 16 12:39:35 2009 @@ -1 +1 @@ -2.17.4 +2.17.5 Modified: branches/SuSE-Code-11-Branch/backup/package/yast2-backup.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/backup/pac... ============================================================================== --- branches/SuSE-Code-11-Branch/backup/package/yast2-backup.changes (original) +++ branches/SuSE-Code-11-Branch/backup/package/yast2-backup.changes Fri Jan 16 12:39:35 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Jan 16 12:35:47 CET 2009 - locilka@suse.cz + +- Fixed Automatic Backup for profiles with a space character in + the profile name (bnc #466750). +- 2.17.5 + +------------------------------------------------------------------- Tue Jan 13 15:47:54 CET 2009 - locilka@suse.cz - Fixed editing the Ext2 File System Critical Area Backup items Modified: branches/SuSE-Code-11-Branch/backup/src/functions.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/backup/src... ============================================================================== --- branches/SuSE-Code-11-Branch/backup/src/functions.ycp (original) +++ branches/SuSE-Code-11-Branch/backup/src/functions.ycp Fri Jan 16 12:39:35 2009 @@ -77,10 +77,12 @@ * Ask user for some value: display dialog with label, text entry and OK/Cancel buttons. * @param label Displayed text above the text entry in the dialog * @param value Default text in text entry, for empty text set value to "" or nil + * @param list <string> values - pre-defined values for combo-box + * @param list <string> forbidden_letters - letters that will be filtered out * @return map Returned map: $[ "text" : string, "clicked" : symbol ]. Value with key text is string entered by user, symbol is `ok or `cancel depending which button was pressed. */ - define map ShowEditDialog(string label, string value, list<string> values) { + define map ShowEditDialog(string label, string value, list<string> values, list <string> forbidden_letters) { if (label == nil) { @@ -121,6 +123,12 @@ string text = (string) UI::QueryWidget(`id(`te), `Value); UI::CloseDialog(); + if (forbidden_letters != nil && forbidden_letters != []) { + foreach (string one_letter, forbidden_letters, { + text = mergestring (splitstring (text, one_letter), ""); + }); + } + return $[ "text" : text, "clicked" : input ]; } Modified: branches/SuSE-Code-11-Branch/backup/src/scripts/backup_cron URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/backup/src... ============================================================================== --- branches/SuSE-Code-11-Branch/backup/src/scripts/backup_cron (original) +++ branches/SuSE-Code-11-Branch/backup/src/scripts/backup_cron Fri Jan 16 12:39:35 2009 @@ -37,5 +37,4 @@ # start backup - set cron mode, set nice level to not slowdown other processes # set server component testsuite to parse UI requests -nice -n 15 /usr/lib/YaST2/bin/y2base backup '("cron")' '("'$PROFILE'")' UI > /dev/null - +nice -n 15 /usr/lib/YaST2/bin/y2base backup "("cron")" "("${PROFILE}")" UI > /dev/null Modified: branches/SuSE-Code-11-Branch/backup/src/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/backup/src... ============================================================================== --- branches/SuSE-Code-11-Branch/backup/src/ui.ycp (original) +++ branches/SuSE-Code-11-Branch/backup/src/ui.ycp Fri Jan 16 12:39:35 2009 @@ -1385,7 +1385,7 @@ if (ret == `edit) { - map edited = ShowEditDialog(Label::EditButton(), curr, nil); + map edited = ShowEditDialog(Label::EditButton(), curr, nil, []); if (edited["clicked"]:nil == `ok) { @@ -1449,7 +1449,7 @@ ); // popup dialog header - map result = ShowEditDialog(_("&Add Ext2 Partition"), "", detected_ext2_strings); + map result = ShowEditDialog(_("&Add Ext2 Partition"), "", detected_ext2_strings, []); if (((symbol)(result["clicked"]:nil)) == `ok) { @@ -2904,7 +2904,8 @@ // TRANSLATORS: text of a popup dialog, %1 is a profile name to be renamed dialog_text = sformat(_("Enter a new name for the %1 profile."), current_name); } - map new_name = ShowEditDialog(dialog_text, "", nil); + // double-quote in name breaks backup in several places + map new_name = ShowEditDialog(dialog_text, "", nil, ["""]); while( (symbol)(new_name["clicked"]:nil) == `ok && Backup::backup_profiles[ (string)(new_name["text"]:nil) ]:nil != nil ) { @@ -2912,7 +2913,8 @@ if( ! Popup::YesNo(sformat(_("A profile %1 already exists. Replace the existing profile? "), new_name["text"]:"")) ) { - new_name = ShowEditDialog(_("Enter a name for the new profile."), "", nil); + // double-quote in name breaks backup at several places + new_name = ShowEditDialog(_("Enter a name for the new profile."), "", nil, ["""]); } else { @@ -3236,6 +3238,7 @@ if( new_name != "" ) { Backup::StoreSettingsToBackupProfile( new_name ); + } } @@ -3330,14 +3333,17 @@ //map current_settings = (map)eval(current_profile[`cron_settings]:$[]); Backup::StoreSettingsToBackupProfile( new_name ); + // "Renaming", Cron settings, It seems to be a hack }8-> Backup::backup_profiles[new_name, `cron_settings] = Backup::backup_profiles[current_name, `cron_settings]:$[]; // Setting that cron settings were changed Backup::backup_profiles[new_name, `cron_settings, "cron_changed"] = true; Backup::backup_profiles[current_name, `cron_settings, "cron_changed"] = true; + // Remove the backup profile, but do not remove cron file Backup::RemoveBackupProfile( current_name, false ); + return new_name; } return nil; @@ -3870,7 +3876,7 @@ void AddExcludeItem_Regexp () { // textentry label - map result = ShowEditDialog(_("&Add New Expression"), "", nil); + map result = ShowEditDialog(_("&Add New Expression"), "", nil, []); if (result["clicked"]:nil == `ok) { string new_regexp = (string) (result["text"]:nil); @@ -3891,7 +3897,7 @@ void AddExcludeItem_Dir () { // textentry label - map result = ShowEditDialog(_("&Add New Directory"), "", nil); + map result = ShowEditDialog(_("&Add New Directory"), "", nil, []); if (result["clicked"]:nil == `ok) { string new = (string)(result["text"]:nil); @@ -3912,7 +3918,7 @@ void AddExcludeItem_Fs (list <string> & all_fss) { // combobox label - map result = ShowEditDialog(_("&Add New File System"), "", all_fss); + map result = ShowEditDialog(_("&Add New File System"), "", all_fss, []); if (result["clicked"]:nil == `ok) { string new = (string)(result["text"]:nil); @@ -3933,7 +3939,7 @@ void ExcludeItemEdit (string value, string type, list <string> & all_fss) { // textentry label - map result = ShowEditDialog(Label::EditButton(), value, (type == filesystem_text) ? all_fss : nil); + map result = ShowEditDialog(Label::EditButton(), value, (type == filesystem_text) ? all_fss : nil, []); if (result["clicked"]:nil == `ok) { string new_txt = (string)(result["text"]:nil); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org