Author: fehr Date: Wed Dec 19 16:57:19 2007 New Revision: 43190 URL: http://svn.opensuse.org/viewcvs/yast?rev=43190&view=rev Log: prevent endless loop in proposal code (#343900) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/do_proposal_flexible.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=43190&r1=43189&r2=43190&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Wed Dec 19 16:57:19 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed Dec 19 16:54:32 CET 2007 - fehr@suse.de + +- prevent endless loop in proposal code (#343900) + +------------------------------------------------------------------- Tue Dec 18 19:17:41 CET 2007 - fehr@suse.de - do not propose to format partition for /home if it already Modified: trunk/storage/storage/src/include/do_proposal_flexible.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/do_proposal_flexible.ycp?rev=43190&r1=43189&r2=43190&view=diff ============================================================================== --- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original) +++ trunk/storage/storage/src/include/do_proposal_flexible.ycp Wed Dec 19 16:57:19 2007 @@ -2516,7 +2516,8 @@ list<map> partitions = disk["partitions"]:[]; list<map> pl = filter( map p, partitions, ``( p["linux"]:false && size(p["mount"]:"")==0 && - !p["delete"]:false )); + !p["delete"]:false && + Storage::CanDelete( p, disk, false ))); if( size(pl)>0 ) { pl = sort( map a, map b, pl, @@ -2548,7 +2549,8 @@ list<map> partitions = disk["partitions"]:[]; list<map> pl = filter( map p, partitions, ``( p["linux"]:false && size(p["mount"]:"")==0 && - !p["delete"]:false )); + !p["delete"]:false && + Storage::CanDelete( p, disk, false ))); if( size(pl)>0 ) { pl = sort( map a, map b, pl, @@ -2661,31 +2663,42 @@ }); } } - else if( mode == `reuse || mode == `remove ) + else if( mode == `reuse ) { valid = listmap( string s, ddev, ``{ if( find( map p, target[s,"partitions"]:[], ``(p["linux"]:false && size(p["mount"]:"")==0 && - !p["delete"]:false)) != nil ) + !p["delete"]:false && + Storage::CanEdit(p,false))) != nil ) return( $[s:true] ); else return( $[s:false] ); }); - if( mode == `remove ) - { - foreach( string s, ddev, - ``{ - target[s,"partitions"] = - remove_p_settings( target[s,"partitions"]:[], - ["/", "/home"] ); - }); - foreach( string s, filter( string d, ddev, ``(valid[d]:false)), - ``{ - target[s,"partitions"] = - remove_one_partition( target[s]:$[] ); - }); - } + } + else if( mode == `remove ) + { + valid = listmap( string s, ddev, + ``{ + if( find( map p, target[s,"partitions"]:[], + ``(p["linux"]:false && size(p["mount"]:"")==0 && + !p["delete"]:false && + Storage::CanDelete(p,target[s]:$[],false))) != nil ) + return( $[s:true] ); + else + return( $[s:false] ); + }); + foreach( string s, ddev, + ``{ + target[s,"partitions"] = + remove_p_settings( target[s,"partitions"]:[], + ["/", "/home"] ); + }); + foreach( string s, filter( string d, ddev, ``(valid[d]:false)), + ``{ + target[s,"partitions"] = + remove_one_partition( target[s]:$[] ); + }); } else if( mode == `resize ) { @@ -2887,7 +2900,7 @@ max_disk = s; } }); - y2milestone( "max_mb %1 size_mb %2", max_mb, size_mb ); + y2milestone( "get_inst_proposal max_mb %1 size_mb %2", max_mb, size_mb ); if( max_mb>0 && size_mb[max_disk,0]:0 > 2*1024 && ( !Storage::ProposalHome() || size_mb[max_disk,1]:0 > 1*1024 )) { @@ -3441,7 +3454,8 @@ ``{ if( find( map p, target[s,"partitions"]:[], ``(p["linux"]:false && size(p["mount"]:"")==0 && - !p["delete"]:false)) != nil ) + !p["delete"]:false && + Storage::CanDelete(p,target[s]:$[],false))) != nil ) return( $[s:true] ); else return( $[s:false] ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org