[yast-commit] r65550 - in /branches/SuSE-Code-11-SP2-Branch/storage: package/yast2-storage.changes storage/src/include/custom_part_dialogs.ycp storage/src/modules/FileSystems.ycp
![](https://seccdn.libravatar.org/avatar/bb376bca2c19e74eb46fa87c724f1105.jpg?s=120&d=mm&r=g)
Author: fehr Date: Mon Sep 5 16:36:09 2011 New Revision: 65550 URL: http://svn.opensuse.org/viewcvs/yast?rev=65550&view=rev Log: fix wrong size check for tmpfs Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Mon Sep 5 16:36:09 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Sep 5 16:01:05 CEST 2011 - fehr@suse.de + +- fix wrong size check for tmpfs + +------------------------------------------------------------------- Mon Sep 05 14:17:29 CEST 2011 - aschnell@suse.de - handle device name change in btrfs (bnc#715652) Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp Mon Sep 5 16:36:09 2011 @@ -202,39 +202,70 @@ string valid_chars = entry[`valid_chars]:""; integer str_length = entry[`str_length]:0; - if( between != [] && (size(query)>0 || !entry[`empty_allowed]:false)) + if( entry[`query_key]:""=="tmpfs_size" ) { - y2milestone( "DoInputChecks entry:%1 query:\"%2\"", entry, query ); - if( between[0]:0 > tointeger(query) || - ( (between[1]:0 != -1) && (between[1]:0 < tointeger(query) ) ) ) + integer sz=0; + integer pospct = search( query, "%" ); + integer posdot = search( query, "." ); + if( posdot == nil ) + posdot = search( query, "," ); + if( posdot!=nil ) { - Popup::Error(entry[`error_text]:""); + Popup::Error(_("No floating point number!")); ret = `error; } - } - if( below != 0 && (size(query)>0 || !entry[`empty_allowed]:false)) - { - y2milestone( "DoInputChecks entry:%1 query:\"%2\"", entry, query ); - if( below < tofloat(query) ) + else { - Popup::Error(entry[`error_text]:""); - ret = `error; + if( pospct!=nil && (between[0]:0 > tointeger(query) || + ( (between[1]:0 != -1) && (between[1]:0 < tointeger(query) )) ) ) + { + Popup::Error(entry[`error_text_percent]:""); + ret = `error; + } + else if( pospct==nil && + (!Storage::HumanStringToByte( query, sz ) || + sz<entry[`min_size]:1 )) + { + Popup::Error(entry[`error_text]:""); + ret = `error; + } } } - if( valid_chars != "" && size(query)>0 && ret != `error ) + else { - if( nil != findfirstnotof( query, valid_chars )) + if( between != [] && (size(query)>0 || !entry[`empty_allowed]:false)) + { + y2milestone( "DoInputChecks entry:%1 query:\"%2\"", entry, query ); + if( between[0]:0 > tointeger(query) || + ( (between[1]:0 != -1) && (between[1]:0 < tointeger(query) ) ) ) + { + Popup::Error(entry[`error_text]:""); + 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 )) + { + Popup::Error(entry[`error_text]:""); + ret = `error; + } + } + if( str_length != 0 && size(query) > str_length && ret != `error ) { Popup::Error(entry[`error_text]:""); ret = `error; } } - - if( str_length != 0 && size(query) > str_length && ret != `error ) - { - Popup::Error(entry[`error_text]:""); - ret = `error; - } y2milestone( "DoInputChecks value %1 ret %2", query, ret ); return( ret ); } Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp Mon Sep 5 16:36:09 2011 @@ -332,15 +332,17 @@ }; list< map<symbol, any> > tmpfs_fst_options = [ - $[ `widget : `TextEntry( `id("size"), `opt(`hstretch), + $[ `widget : `TextEntry( `id("tmpfs_size"), `opt(`hstretch), // label text _("Tmpfs &Size"), "" ), - `query_key : "size", - `between : [ 1, 200 ], + `query_key : "tmpfs_size", + `between : [ 1, 200 ], `empty_allowed : true, + `min_size : 100*1024, `valid_chars : "0123456789kKmMgG%", // popup text - `error_text : _("Value must be larger than 0. Try again."), + `error_text : _("Value must be above 100k or between 1% and 200%. Try again."), + `error_text_percent : _("Value must be 1% and 200%. Try again."), `type : `text, `str_opt : "size=%1", `str_scan : "size=\(.*\)", -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
fehr@svn2.opensuse.org