[yast-commit] r60292 - in /trunk/storage: bindings/ycp/ package/ storage/src/modules/ storage/src/testsuite/data/reuse-home/ storage/src/testsuite/data/windows-only/
Author: aschnell Date: Fri Jan 8 14:56:46 2010 New Revision: 60292 URL: http://svn.opensuse.org/viewcvs/yast?rev=60292&view=rev Log: - delay ntfs resize check until partitioning proposal (bnc #533568) Modified: trunk/storage/bindings/ycp/LibStorage.i trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/modules/Storage.ycp trunk/storage/storage/src/testsuite/data/reuse-home/free.info trunk/storage/storage/src/testsuite/data/windows-only/free.info Modified: trunk/storage/bindings/ycp/LibStorage.i URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/bindings/ycp/LibStorage.i?rev=60292&r1=60291&r2=60292&view=diff ============================================================================== --- trunk/storage/bindings/ycp/LibStorage.i (original) +++ trunk/storage/bindings/ycp/LibStorage.i Fri Jan 8 14:56:46 2010 @@ -41,6 +41,8 @@ specialize_sequence(storage::DmmultipathInfo, TO_PACK, FROM_PACK, CHECK) specialize_sequence(storage::PartitionSlotInfo, TO_PACK, FROM_PACK, CHECK) specialize_sequence(storage::CommitInfo, TO_PACK, FROM_PACK, CHECK) +specialize_sequence(storage::ResizeInfo, TO_PACK, FROM_PACK, CHECK) +specialize_sequence(storage::ContentInfo, TO_PACK, FROM_PACK, CHECK) specialize_sequence(storage::Environment, TO_PACK, FROM_PACK, CHECK) Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=60292&r1=60291&r2=60292&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Fri Jan 8 14:56:46 2010 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Fri Jan 08 14:37:40 CET 2010 - aschnell@suse.de + +- delay ntfs resize check until partitioning proposal (bnc #533568) + +------------------------------------------------------------------- Tue Jan 05 16:59:39 CET 2010 - aschnell@suse.de - removed unused parameter from function Storage::DeleteDevice Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=60292&r1=60291&r2=60292&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Fri Jan 8 14:56:46 2010 @@ -68,6 +68,8 @@ import "LibStorage::PartitionSlotInfo"; import "LibStorage::CommitInfo"; import "LibStorage::DlabelCapabilities"; + import "LibStorage::ResizeInfo"; + import "LibStorage::ContentInfo"; import "LibStorage::Environment"; @@ -796,6 +798,45 @@ } +boolean GetFreeInfo(string device, boolean get_resize, map<symbol, any>& resize_info, + boolean get_content, map<symbol, any>& content_info, boolean use_cache) +{ + resize_info = $[]; + content_info = $[]; + + any tmp1 = LibStorage::ResizeInfo::new("LibStorage::ResizeInfo"); + any tmp2 = LibStorage::ContentInfo::new("LibStorage::ContentInfo"); + + boolean ret = LibStorage::StorageInterface::getFreeInfo(sint, device, get_resize, tmp1, + get_content, tmp2, use_cache); + + if (ret) + { + if (get_resize) + { + resize_info = $[ + `df_free_k : LibStorage::ResizeInfo::swig_df_freeK_get(tmp1), + `resize_free_k : LibStorage::ResizeInfo::swig_resize_freeK_get(tmp1), + `used_k : LibStorage::ResizeInfo::swig_usedK_get(tmp1), + `resize_ok : LibStorage::ResizeInfo::swig_resize_ok_get(tmp1) + ]; + } + + if (get_content) + { + content_info = $[ + `windows : LibStorage::ContentInfo::swig_windows_get(tmp2), + `efi : LibStorage::ContentInfo::swig_efi_get(tmp2), + `home : LibStorage::ContentInfo::swig_home_get(tmp2) + ]; + } + } + + y2milestone("GetFreeInfo device:%1 ret:%2", device, ret); + return ret; +} + + /** * Returns map of free space per partition * @@ -806,23 +847,20 @@ */ global map GetFreeSpace(string device, integer testsize, symbol used_fs, boolean verbose) { - integer used = 0; - integer resize_free = 0; - integer df_free = 0; - boolean win_disk = false; - boolean efi = false; - boolean home = false; - - boolean r = false; - r = LibStorage::StorageInterface::getFreeInfo( sint, device, resize_free, - df_free, used, win_disk, - efi, home, used_fs==`ntfs ); - - resize_free = resize_free * 1024; // Byte - df_free = df_free * 1024; // Byte - used = used * 1024; // Byte + map<symbol, any> resize_info = $[]; + map<symbol, any> content_info = $[]; + + boolean r = GetFreeInfo(device, true, resize_info, true, content_info, used_fs == `ntfs); + + integer used = 1024 * resize_info[`used_k]:0; + integer resize_free = 1024 * resize_info[`resize_free_k]:0; + integer df_free = 1024 * resize_info[`df_free_k]:0; + boolean resize_ok = resize_info[`resize_ok]:false; - if( used_fs == `ntfs && !r && verbose ) + boolean win_disk = content_info[`windows]:false; + boolean efi = content_info[`efi]:false; + + if( used_fs == `ntfs && (!r || !resize_ok) && verbose ) { string cmd = sformat("/usr/sbin/ntfsresize -f -i '%1'", device); y2milestone( "GetFreeSpace Executing cmd:%1", cmd ); @@ -3510,17 +3548,14 @@ if( !p["created"]:false && contains( poss_fs, p["detected_fs"]:`unknown ) && !isempty(device) ) { - integer used = 0; - integer resize_free = 0; - integer df_free = 0; - boolean win_disk = false; - boolean efi = false; - boolean home = false; - - if (LibStorage::StorageInterface::getFreeInfo(sint, device, resize_free, - df_free, used, win_disk, - efi, home, true)) - ret = home; + map<symbol, any> resize_info = $[]; + map<symbol, any> content_info = $[]; + + if (GetFreeInfo(device, false, resize_info, true, content_info, true) && + content_info[`home]:false) + { + ret = true; + } } y2milestone("DetectHomeFs device:%1 ret:%2", device, ret); return ret; @@ -4058,8 +4093,6 @@ list<map> GetPrimPartitions(map<string, map> targets, boolean foreign_os) { list<map> ret = []; - map entry = $[]; - string text = ""; integer num_dos = 0; integer num_win = 0; integer num_os2 = 0; @@ -4078,10 +4111,15 @@ SCR::Execute (.target.bash, "/usr/lib/YaST2/bin/check.boot "+device) == 0) { - text = ""; + string text = ""; if( Partitions::IsDosWinNtPartition( part["fsid"]:0 ) && - data["used_by_type"]:`UB_NONE==`UB_NONE && - GetFreeSpace( device, 0, part["used_fs"]:`none, false )["win_disk"]:false ) + data["used_by_type"]:`UB_NONE==`UB_NONE ) + { + map<symbol, any> resize_info = $[]; + map<symbol, any> content_info = $[]; + + if (GetFreeInfo(device, false, resize_info, true, content_info, true) && + content_info[`windows]:false) { if( contains( Partitions::fsid_dostypes, part["fsid"]:0 ) ) { @@ -4094,6 +4132,7 @@ text = win_text; } } + } else if( part["fsid"]:0 == 0x12 && !foreign_os ) { text = "Vendor diagnostic"; @@ -4109,18 +4148,18 @@ text = linux_text; num_linux = num_linux+1; } - if( size(text)>0 ) + if (!isempty(text)) { - entry["device"] = device; - entry["string"] = text; - ret = add( ret, eval(entry) ); - y2milestone( "new entry %1", entry ); + map entry = $[ "device" : device, "text" : text ]; + y2milestone( "new entry %1", entry ); + ret = add(ret, entry); } } }); }); y2milestone( "GetPrimPartitions foreign_os:%5 num_linux %1 num_win %2 num_dos %3 num_os2 %4", num_linux, num_win, num_dos, num_os2, foreign_os ); + integer num = 1; if( num_linux>1 ) { Modified: trunk/storage/storage/src/testsuite/data/reuse-home/free.info URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/testsuite/data/reuse-home/free.info?rev=60292&r1=60291&r2=60292&view=diff ============================================================================== --- trunk/storage/storage/src/testsuite/data/reuse-home/free.info (original) +++ trunk/storage/storage/src/testsuite/data/reuse-home/free.info Fri Jan 8 14:56:46 2010 @@ -1 +1 @@ -/dev/sda3 df_free=23338740 resize_free=23338740 used=26203196 windows=0 efi=0 home=1 resize_ok=1 +/dev/sda3 resize_cached=1 df_free=23338740 resize_free=23338740 used=26203196 resize_ok=1 content_cached=1 windows=0 efi=0 home=1 Modified: trunk/storage/storage/src/testsuite/data/windows-only/free.info URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/testsuite/data/windows-only/free.info?rev=60292&r1=60291&r2=60292&view=diff ============================================================================== --- trunk/storage/storage/src/testsuite/data/windows-only/free.info (original) +++ trunk/storage/storage/src/testsuite/data/windows-only/free.info Fri Jan 8 14:56:46 2010 @@ -1 +1 @@ -/dev/sda1 df_free=64991212 resize_free=64991212 used=13156948 windows=1 efi=0 home=0 resize_ok=1 +/dev/sda1 resize_cached=1 df_free=64991212 resize_free=64991212 used=13156948 resize_ok=1 content_cached=1 windows=1 efi=0 home=0 -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org