Author: aschnell Date: Wed Dec 16 13:58:52 2009 New Revision: 60122 URL: http://svn.opensuse.org/viewcvs/yast?rev=60122&view=rev Log: - read meminfo normally in testmode Modified: trunk/storage/storage/src/modules/Partitions.ycp Modified: trunk/storage/storage/src/modules/Partitions.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Partitions.ycp?rev=60122&r1=60121&r2=60122&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Partitions.ycp (original) +++ trunk/storage/storage/src/modules/Partitions.ycp Wed Dec 16 13:58:52 2009 @@ -334,20 +334,14 @@ return( !IsDosWinNtPartition( fsid ) && fsid==fsid_swap ); } -global define integer SwapSizeMb( integer slot_size ) - ``{ - integer swap_size = 0; +global integer SwapSizeMb( integer slot_size ) + { + map mem_info_map = (map) SCR::Read(.proc.meminfo); + integer mem = mem_info_map["memtotal"]:0 / 1024; + y2milestone("mem_info_map:%1 mem:%2", mem_info_map, mem); // a good approach swap == mem x 2 - integer mem = 256; - if( !Mode::test () ) - { - map mem_info_map = (map) SCR::Read(.proc.meminfo); - y2milestone( "mem_info_map %1", mem_info_map ); - mem = mem_info_map["memtotal"]:0; - mem = mem / 1024; - } - if( mem == 0 || mem == nil ) mem = 64; + integer swap_size = 0; if( slot_size==0 ) { @@ -424,7 +418,7 @@ y2milestone( "SwapSizeMb mem %1 slot_size %2 swap_size %3", mem, slot_size, swap_size ); return( swap_size ); - }; + } global define boolean IsResizable( integer fsid ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org