Author: aschnell
Date: Wed Feb 18 15:15:43 2009
New Revision: 55587
URL: http://svn.opensuse.org/viewcvs/yast?rev=55587&view=rev
Log:
- converted proposal code to a module
Added:
trunk/storage/storage/src/modules/StorageProposal.ycp (contents, props changed)
- copied, changed from r55577, trunk/storage/storage/src/include/do_proposal_flexible.ycp
Removed:
trunk/storage/storage/src/include/do_proposal_flexible.ycp
Modified:
trunk/storage/VERSION
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/auto_part_create.ycp
trunk/storage/storage/src/inst_disk_proposal.ycp
trunk/storage/storage/src/inst_resize_dialog.ycp
trunk/storage/storage/src/inst_resize_ui.ycp
trunk/storage/storage/src/inst_target_part.ycp
trunk/storage/storage/src/modules/Makefile.am
trunk/storage/storage/src/proposal/partitions_proposal.ycp
Modified: trunk/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/VERSION (original)
+++ trunk/storage/VERSION Wed Feb 18 15:15:43 2009
@@ -1 +1 @@
-2.18.6
+2.18.7
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Wed Feb 18 15:15:43 2009
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Feb 18 14:44:45 CET 2009 - aschnell@suse.de
+
+- converted proposal code to a module
+
+-------------------------------------------------------------------
Fri Feb 13 12:42:07 CET 2009 - aschnell@suse.de
- use Sequencer.ycp instead of deprecated sequencer.ycp
Modified: trunk/storage/storage/src/include/auto_part_create.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/auto_part_create.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/include/auto_part_create.ycp (original)
+++ trunk/storage/storage/src/include/auto_part_create.ycp Wed Feb 18 15:15:43 2009
@@ -19,17 +19,16 @@
import "Storage";
import "Partitions";
import "ProductFeatures";
-
-include "partitioning/do_proposal_flexible.ycp";
+ import "StorageProposal";
boolean create_partitions( map tgmap, map disk, list<map> partitions )
{
y2milestone( "create_partitions disk:%1",
haskey(disk,"partitions")?remove(disk,"partitions"):disk );
y2milestone( "create_partitions partitions %1", partitions );
- flex_init_swapable( tgmap );
+ StorageProposal::flex_init_swapable( tgmap );
boolean ret = false;
- boolean has_flex = has_flex_proposal();
+ boolean has_flex = StorageProposal::has_flex_proposal();
string vm = Storage::ProposalVM();
y2milestone( "create_partitions flex %1 vm %2", has_flex, vm );
disk["partitions"] = partitions;
@@ -39,7 +38,7 @@
{
if( has_flex )
{
- map flex = do_flexible_disk( disk );
+ map flex = StorageProposal::do_flexible_disk( disk );
if( flex["ok"]:false )
partitions = flex["disk","partitions"]:[];
}
@@ -51,7 +50,7 @@
integer num_del_free = size(filter(map p, partitions,
``(p["type"]:`unknown==`free&&
p["delete"]:false)));
- map r = can_swap_reuse( disk["device"]:"", partitions, tgmap );
+ map r = StorageProposal::can_swap_reuse( disk["device"]:"", partitions, tgmap );
if( haskey( r, "partitions" ))
partitions = r["partitions"]:[];
else if( haskey( r, "targets" ))
@@ -80,7 +79,7 @@
}
else
{
- partitions = get_proposal( size(r)>0, disk );
+ partitions = StorageProposal::get_proposal( size(r)>0, disk );
}
}
y2milestone( "create_partitions %1", partitions );
@@ -100,7 +99,7 @@
});
y2milestone( "create_partitions id_save %1", id_save );
y2milestone( "create_partitions ps %1", disk["partitions"]:[] );
- map r = get_proposal_vm( tgmap, vm, disk );
+ map r = StorageProposal::get_proposal_vm( tgmap, vm, disk );
ret = r["ok"]:false;
if( ret )
{
Modified: trunk/storage/storage/src/inst_disk_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_disk_proposal.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_disk_proposal.ycp (original)
+++ trunk/storage/storage/src/inst_disk_proposal.ycp Wed Feb 18 15:15:43 2009
@@ -29,9 +29,10 @@
import "Popup";
import "Storage";
import "Sequencer";
+ import "StorageProposal";
include "partitioning/custom_part_check_generated.ycp";
- include "partitioning/do_proposal_flexible.ycp";
+
define boolean AskOverwriteChanges()
``{
@@ -137,7 +138,7 @@
string changes = "";
if( Storage::GetPartProposalFirst() )
{
- map prop = get_inst_prop( Storage::GetTargetMap() );
+ map prop = StorageProposal::get_inst_prop(Storage::GetTargetMap());
y2milestone( "prop ok:%1", prop["ok"]:false );
if( prop["ok"]:false )
{
@@ -282,7 +283,7 @@
Storage::SetProposalLvm(false);
Storage::ResetOndiskTarget();
Storage::AddMountPointsForWin(Storage::GetTargetMap());
- map prop = get_inst_prop( Storage::GetTargetMap());
+ map prop = StorageProposal::get_inst_prop(Storage::GetTargetMap());
if( !prop["ok"]:false )
{
Popup::Error( _("Impossible to create the requested proposal.") );
Modified: trunk/storage/storage/src/inst_resize_dialog.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_resize_dialog.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_resize_dialog.ycp (original)
+++ trunk/storage/storage/src/inst_resize_dialog.ycp Wed Feb 18 15:15:43 2009
@@ -25,9 +25,10 @@
import "Wizard";
import "Product";
import "Installation";
+import "StorageProposal";
include "partitioning/partition_defines.ycp";
-include "partitioning/do_proposal_flexible.ycp";
+
list<integer> DiskUsage (string win_device) {
integer win_used = -1;
@@ -414,7 +415,7 @@
if (Storage::resize_partition == nil) {
Storage::ResetOndiskTarget();
Storage::AddMountPointsForWin(Storage::GetTargetMap());
- get_inst_prop (Storage::GetTargetMap ());
+ StorageProposal::get_inst_prop(Storage::GetTargetMap());
if (Storage::resize_partition == nil) // no resize
{
Storage::ResetOndiskTarget();
@@ -434,7 +435,7 @@
Storage::ResetOndiskTarget();
Storage::AddMountPointsForWin(Storage::GetTargetMap());
map prop = $[];
- prop = get_inst_prop( Storage::GetTargetMap());
+ prop = StorageProposal::get_inst_prop(Storage::GetTargetMap());
y2milestone( "prop ok:%1", prop["ok"]:false );
if( prop["ok"]:false ) {
Storage::SetTargetMap( prop["target"]:$[] );
Modified: trunk/storage/storage/src/inst_resize_ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_resize_ui.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_resize_ui.ycp (original)
+++ trunk/storage/storage/src/inst_resize_ui.ycp Wed Feb 18 15:15:43 2009
@@ -23,7 +23,6 @@
import "Installation";
include "partitioning/partition_defines.ycp";
- include "partitioning/do_proposal_flexible.ycp";
// Automatically return if resizing is not requested
//
Modified: trunk/storage/storage/src/inst_target_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_target_part.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_target_part.ycp (original)
+++ trunk/storage/storage/src/inst_target_part.ycp Wed Feb 18 15:15:43 2009
@@ -389,7 +389,7 @@
}
return( p );
});
- partitions = try_remove_sole_extended( partitions );
+ partitions = StorageProposal::try_remove_sole_extended( partitions );
y2milestone ("partitions '%1'", partitions);
Modified: trunk/storage/storage/src/modules/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Makefile.am?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Makefile.am (original)
+++ trunk/storage/storage/src/modules/Makefile.am Wed Feb 18 15:15:43 2009
@@ -15,6 +15,7 @@
StorageControllers.ycp \
StorageDevices.ycp \
StorageFields.ycp \
+ StorageProposal.ycp \
StorageSettings.ycp \
StorageIcons.ycp \
TreePanel.ycp \
Copied: trunk/storage/storage/src/modules/StorageProposal.ycp (from r55577, trunk/storage/storage/src/include/do_proposal_flexible.ycp)
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageProposal.ycp?p2=trunk/storage/storage/src/modules/StorageProposal.ycp&p1=trunk/storage/storage/src/include/do_proposal_flexible.ycp&r1=55577&r2=55587&rev=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ trunk/storage/storage/src/modules/StorageProposal.ycp Wed Feb 18 15:15:43 2009
@@ -11,19 +11,17 @@
*
* Description: Make a proposal for partitioning
*
- *
- *************************************************************
-
- $Id$
-*/
+ *************************************************************/
{
+ module "StorageProposal";
-textdomain "storage";
+ textdomain "storage";
-import "FileSystems";
-import "Partitions";
-import "Storage";
-import "ProductFeatures";
+ import "FileSystems";
+ import "Partitions";
+ import "Storage";
+ import "ProductFeatures";
+ import "Arch";
map read_partition_config( string fpath );
map read_partition_xml_config();
@@ -78,7 +76,7 @@
map swapable = $[];
-void flex_init_swapable( map tg )
+global void flex_init_swapable( map tg )
{
swapable = $[];
list swaps = Storage::SwappingPartitions();
@@ -110,7 +108,7 @@
return( "/part.info" );
}
-define boolean has_flex_proposal()
+global boolean has_flex_proposal()
``{
boolean ret = (integer)SCR::Read( .target.size, pinfo_name() )>0;
if( !ret )
@@ -162,7 +160,7 @@
return( tc );
}
-define map do_flexible_disk( map disk )
+global map do_flexible_disk( map disk )
``{
string dev = disk["device"]:"";
y2milestone( "do_flexible_disk dev %1", dev );
@@ -1400,6 +1398,7 @@
return( g );
};
+
define map distribute_space( integer rest, list weights, list added, list ps )
``{
integer diff_sum = 0;
@@ -1461,6 +1460,7 @@
return( ret );
}
+
define integer do_weighting( list ps, map g )
``{
y2milestone( "do_weighting gap %1", g["gap"]:[] );
@@ -1553,7 +1553,7 @@
return( ret );
};
-define list<map> try_remove_sole_extended( list<map> parts )
+global list<map> try_remove_sole_extended( list<map> parts )
{
list<map> ret = parts;
if( find( map p, ret,
@@ -2143,7 +2143,7 @@
return( conf );
}
-map can_swap_reuse( string disk, list<map> partitions, map tgmap )
+global map can_swap_reuse( string disk, list<map> partitions, map tgmap )
{
map ret = $[];
y2milestone( "can_swap_reuse disk %1 partitions %2", disk, partitions );
@@ -2309,7 +2309,7 @@
return( l );
}
-list<map> get_proposal( boolean have_swap, map disk )
+global list<map> get_proposal( boolean have_swap, map disk )
{
list<map> ret = [];
y2milestone( "get_proposal have_swap:%1 disk %2", have_swap, disk );
@@ -3140,17 +3140,6 @@
return( ret );
}
-integer round_mb_pe( integer mb, integer pebyte )
- {
- integer pek = pebyte/1024;
- if( pek<1 )
- pek = 1;
- integer ret = (mb*1024 + pek-1) / pek * pek;
- if( ret==0 )
- ret=1;
- y2milestone( "round_mb_pe mb %1 pebyte %2 ret %3", mb, pebyte, ret );
- return( ret );
- }
map modify_vm( map vm, map opts, boolean need_swap )
{
@@ -3627,7 +3616,7 @@
return( ret );
}
-map get_proposal_vm( map target, string key, map disk )
+global map get_proposal_vm( map target, string key, map disk )
{
string ddev = disk["device"]:"";
y2milestone("get_proposal_vm ddev:%1 vg:%2 lvm:%3 home:%4", ddev,
@@ -3683,7 +3672,7 @@
return( ret );
}
-map get_inst_prop( map target )
+global map get_inst_prop( map target )
{
map ret = $[];
string vg = Storage::ProposalVM();
@@ -3705,4 +3694,3 @@
}
}
-
Modified: trunk/storage/storage/src/proposal/partitions_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/proposal/partitions_proposal.ycp?rev=55587&r1=55586&r2=55587&view=diff
==============================================================================
--- trunk/storage/storage/src/proposal/partitions_proposal.ycp (original)
+++ trunk/storage/storage/src/proposal/partitions_proposal.ycp Wed Feb 18 15:15:43 2009
@@ -1,4 +1,4 @@
- /**
+/**
* Module: proposal_partitions.ycp
*
* $Id$
@@ -17,8 +17,7 @@
import "Mode";
import "Storage";
import "Sequencer";
-
- include "partitioning/do_proposal_flexible.ycp";
+ import "StorageProposal";
string func = (string) WFM::Args(0);
map param = (map) WFM::Args(1);
@@ -45,7 +44,7 @@
Storage::AddMountPointsForWin(Storage::GetTargetMap());
}
map prop = $[];
- prop = get_inst_prop( Storage::GetTargetMap());
+ prop = StorageProposal::get_inst_prop( Storage::GetTargetMap());
y2milestone( "prop ok:%1", prop["ok"]:false );
if( prop["ok"]:false )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org