Author: fehr Date: Tue Jan 18 12:10:13 2011 New Revision: 63196 URL: http://svn.opensuse.org/viewcvs/yast?rev=63196&view=rev Log: allow floating point value in reserved block percentage and set default to reserve about 1Gig, but <= 5.0% and >= 0.1% (bnc #661953) Modified: branches/SuSE-Linux-11_4-Branch/storage/package/yast2-storage.changes branches/SuSE-Linux-11_4-Branch/storage/storage/src/include/custom_part_dialogs.ycp branches/SuSE-Linux-11_4-Branch/storage/storage/src/modules/FileSystems.ycp Modified: branches/SuSE-Linux-11_4-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_4-Branch/storage/package/yast2-storage.changes?rev=63196&r1=63195&r2=63196&view=diff ============================================================================== --- branches/SuSE-Linux-11_4-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Linux-11_4-Branch/storage/package/yast2-storage.changes Tue Jan 18 12:10:13 2011 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jan 17 17:28:51 CET 2011 - fehr@suse.de + +- allow floating point value in reserved block percentage and + set default to reserve about 1Gig, but <= 5.0% and >= 0.1% + (bnc #661953) + +------------------------------------------------------------------- Thu Oct 21 14:14:10 CEST 2010 - aschnell@suse.de - fixed desktop file (bnc #647261) Modified: branches/SuSE-Linux-11_4-Branch/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_4-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=63196&r1=63195&r2=63196&view=diff ============================================================================== --- branches/SuSE-Linux-11_4-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ branches/SuSE-Linux-11_4-Branch/storage/storage/src/include/custom_part_dialogs.ycp Tue Jan 18 12:10:13 2011 @@ -266,6 +266,7 @@ ``{ symbol ret = `ok; list between = entry[`between]:[]; + integer below = entry[`below]:0; string valid_chars = entry[`valid_chars]:""; integer str_length = entry[`str_length]:0; @@ -279,7 +280,15 @@ ret = `error; } } - + if( below != 0 && (size(query)>0 || !entry[`empty_allowed]:false)) + { + y2milestone( "DoInputChecks entry:%1 query:\"%2\"", entry, query ); + if( below < tofloat(query) ) + { + Popup::Error(entry[`error_text]:""); + ret = `error; + } + } if( valid_chars != "" && size(query)>0 && ret != `error ) { if( nil != findfirstnotof( query, valid_chars )) Modified: branches/SuSE-Linux-11_4-Branch/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_4-Branch/storage/storage/src/modules/FileSystems.ycp?rev=63196&r1=63195&r2=63196&view=diff ============================================================================== --- branches/SuSE-Linux-11_4-Branch/storage/storage/src/modules/FileSystems.ycp (original) +++ branches/SuSE-Linux-11_4-Branch/storage/storage/src/modules/FileSystems.ycp Tue Jan 18 12:10:13 2011 @@ -550,14 +550,14 @@ `query_key : "opt_reserved_blocks", `option_str : "-m", //`default : 5, - `between : [ 0 , 99 ], // -> -1 = infinite - `str_length : 2, - `valid_chars : "0123456789", + `below : 99, + `str_length : 6, + `valid_chars : "0123456789.", // popup text - `error_text : _("The \"Percentage of blocks reserved for root\" value is incorrect.\nPlease use a value between 0 and 99."), + `error_text : _("The \"Percentage of blocks reserved for root\" value is incorrect.\nAllowed are float numbers not larger than 99. (e.g. 0.5)"), // xgettext: no-c-format // help text, richtext format - `help_text : _("<p><b>Percentage of blocks reserved for root:</b> Specify the percentage of blocks reserved for the super user. This value defaults to 5%.</p>") + `help_text : _("<p><b>Percentage of blocks reserved for root:</b> Specify the percentage of blocks reserved for the super user. The default is computed so that normally 1 Gig is reserved. Upper limit for reserved default is 5.0, lowest reserved default is 0.1.</p>") ], $[ // checkbox text @@ -1329,6 +1329,21 @@ ret["opt_blocksize"] = $[ "option_str" : "-b", "option_value" : "4096" ]; } + if( contains( [`ext2, `ext3, `ext4], fsys ) ) + { + if( Arch::s390() ) + { + ret["opt_blocksize"] = $[ "option_str" : "-b", + "option_value" : "4096" ]; + } + float f = (1048576.0 / (part["size_k"]:0)) * 100; + if( f > 5 ) + f = 5; + if( f < 0.1 ) + f = 0.1; + ret["opt_reserved_blocks"] = $[ "option_str" : "-m", + "option_value" : tostring( f, 1 ) ]; + } } y2milestone( "DefaultFormatOptions fsys %1 fmt %2 is %3", fsys, part["format"]:false, ret ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org