Author: aschnell
Date: Tue Feb 10 14:55:27 2009
New Revision: 55387
URL: http://svn.opensuse.org/viewcvs/yast?rev=55387&view=rev
Log:
- replaced some calls of kmgt_str_to_byte
Modified:
trunk/storage/storage/doc/README.part.info
trunk/storage/storage/doc/config.xml.description
trunk/storage/storage/src/include/do_proposal_flexible.ycp
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/storage/doc/README.part.info
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/doc/README.part.info?rev=55387&r1=55386&r2=55387&view=diff
==============================================================================
--- trunk/storage/storage/doc/README.part.info (original)
+++ trunk/storage/storage/doc/README.part.info Tue Feb 10 14:55:27 2009
@@ -67,7 +67,7 @@
PARTITION
- Example: PARTITION mount=/ size=4G fsys=reiser
+ Example: PARTITION mount=/ size=4GB fsys=reiser
Description:
Lines starting with the keyword "PARTITION" describe a partition that is
@@ -79,7 +79,7 @@
General remarks to all option values. If there is a blank or a equal
sign (=) contained in an option value, the values has to be surrounded
by double quotes ("). Values that describe sizes can be followed by the
- letters K, M, G. (K means Kilobytes, M Megabytes and G Gigabytes).
+ letters kB, MB, GB, TB.
Keyword: mount
Example: mount=/
@@ -122,7 +122,7 @@
on a disk.
Keyword: size
- Example: size=2G
+ Example: size=2GB
Example: size=0
Example: size=auto
Description:
@@ -140,7 +140,7 @@
percentage of the available space for installation on a disk.
Keyword: maxsize
- Example: maxsize=4G
+ Example: maxsize=4GB
Description:
This keyword limits the maximal amount of space that is allocated
to a certain partition. This keyword is only useful in conjunction
@@ -172,9 +172,9 @@
without disk keyword is implicity assigned the highest priority 0.
Example: PARTITION mount=/var sizepct=100 disk=3
- PARTITION mount=/ size=1G disk=2
- PARTITION mount=/usr size=2G disk=2
- PARTITION mount=/opt size=2G disk=2
+ PARTITION mount=/ size=1GB disk=2
+ PARTITION mount=/usr size=2GB disk=2
+ PARTITION mount=/opt size=2GB disk=2
PARTITION mount=/home sizepct=100 disk=1
If in the above example the machine has three disks then each of the
Modified: trunk/storage/storage/doc/config.xml.description
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/doc/config.xml.description?rev=55387&r1=55386&r2=55387&view=diff
==============================================================================
--- trunk/storage/storage/doc/config.xml.description (original)
+++ trunk/storage/storage/doc/config.xml.description Tue Feb 10 14:55:27 2009
@@ -11,7 +11,7 @@
This is the lower limit of available disk space that the code tries to
create a proposal with a separate filesystem for /home. If for some reason
less disk space than this is available no separate /home will be proposed.
- Current Value SL: 5G SLES: 5G SLED: 14G
+ Current Value SL: 5GB SLES: 5GB SLED: 14GB
root_space_percent:
This is the percentage of available disk space to use for the root
@@ -24,14 +24,14 @@
root_base_size:
Minimal size of root filesystem if a separate filesystem for /home is to
be created.
- Current Value SL: 3G SLES: 3G SLED: 3G
+ Current Value SL: 3GB SLES: 3GB SLED: 3GB
root_max_size:
Maximal size of root filesystem if a separate filesystem for /home is to
be created. The proposal will not suggest to create a larger root filesystem
than this limit. Instead it will add the unused space to the filesystem for
/home.
- Current Value SL: 10G SLES: 10G SLED: 10G
+ Current Value SL: 10GB SLES: 10GB SLED: 10GB
proposal_lvm:
Determines if a proposal based on LVM is created as default.
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=55387&r1=55386&r2=55387&view=diff
==============================================================================
--- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ trunk/storage/storage/src/include/do_proposal_flexible.ycp Tue Feb 10 14:55:27 2009
@@ -1866,7 +1866,7 @@
if (p["maxsize"]:"" != "")
{
- partition["maxsize"] = kmgt_str_to_byte(p["maxsize"]:"");
+ partition["maxsize"] = Storage::ClassicStringToByte(p["maxsize"]:"");
}
if (p["fsys"]:"" != "")
@@ -1891,7 +1891,7 @@
}
else
{
- partition["size"] = kmgt_str_to_byte( s );
+ partition["size"] = Storage::ClassicStringToByte(s);
}
}
@@ -2076,7 +2076,7 @@
}
else
{
- part["size"] = kmgt_str_to_byte( par );
+ part["size"] = Storage::ClassicStringToByte(par);
}
}
else if( key == "label" )
@@ -2085,7 +2085,7 @@
}
else if( key == "maxsize" )
{
- part[key] = kmgt_str_to_byte( par );
+ part[key] = Storage::ClassicStringToByte(par);
}
else if( key == "sizepct" )
{
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=55387&r1=55386&r2=55387&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Tue Feb 10 14:55:27 2009
@@ -367,6 +367,15 @@
}
+global integer ClassicStringToByte(string str)
+{
+ integer bytes = 0;
+ if (!LibStorage::humanStringToByte(str, true, bytes))
+ y2error("cannot parse %1", str);
+ return bytes;
+}
+
+
global string ByteToHumanString(integer bytes)
{
return LibStorage::byteToHumanString(bytes, false, 2, false);
@@ -6307,14 +6316,6 @@
global map