Author: locilka Date: Thu Apr 10 13:07:08 2008 New Revision: 46332 URL: http://svn.opensuse.org/viewcvs/yast?rev=46332&view=rev Log: - InstInitSourceMoveDownloadArea has been moved into a separate module in SourceManager in order to use it from installation from images too. Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/inst_rpmcopy.ycp trunk/packager/src/modules/SourceManager.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.c... ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Thu Apr 10 13:07:08 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Apr 10 13:07:25 CEST 2008 - locilka@suse.cz + +- InstInitSourceMoveDownloadArea has been moved into a separate + module in SourceManager in order to use it from installation from + images too. + +------------------------------------------------------------------- Tue Apr 8 12:39:18 CEST 2008 - lslezak@suse.cz - removed 'Software Repositories' from the yast control center Modified: trunk/packager/src/clients/inst_rpmcopy.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_rpmcopy... ============================================================================== --- trunk/packager/src/clients/inst_rpmcopy.ycp (original) +++ trunk/packager/src/clients/inst_rpmcopy.ycp Thu Apr 10 13:07:08 2008 @@ -614,44 +614,7 @@ } void InstInitAndInitialSourceCaching () { - map spaces = Pkg::TargetGetDU (); - list root_info = spaces["/tmp"]:spaces["/tmp/"]:spaces["/"]:[]; - integer total = root_info[0]:0; - integer current = root_info[1]:0; - integer future = root_info[2]:0; - if (future < current) - future = current; - integer tmp_space = total - future; - // no temp space left or read-only - if (tmp_space < 0 || root_info[3]:1 == 1) - tmp_space = 0; - - list var_info = spaces["/var/tmp"]:spaces["/var/tmp/"]:spaces["/var"]:spaces["/var/"]:spaces["/"]:[]; - total = var_info[0]:0; - current = var_info[1]:0; - future = var_info[2]:0; - if (future < current) - future = current; - integer var_tmp_space = total - future; - // no temp space left or read-only - if (var_tmp_space < 0 || var_info[3]:1 == 1) - var_tmp_space = 0; - - //------- - // /tmp or /var/tmp ? - - string download_dir = tmp_space > var_tmp_space - ? "/tmp" - : "/var/tmp"; - download_dir = Installation::destdir + download_dir; - integer space = tmp_space > var_tmp_space - ? tmp_space - : var_tmp_space; - if (true) // TODO check the size of the largest package on CD1 - { - SCR::Execute (.target.bash, sformat ("test -d %1 || mkdir %1", download_dir)); - Pkg::SourceMoveDownloadArea (download_dir); - } + SourceManager::InstInitSourceMoveDownloadArea(); if (! regexpmatch (Kernel::GetCmdLine (), "yastnocache")) { Modified: trunk/packager/src/modules/SourceManager.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SourceManage... ============================================================================== --- trunk/packager/src/modules/SourceManager.ycp (original) +++ trunk/packager/src/modules/SourceManager.ycp Thu Apr 10 13:07:08 2008 @@ -34,6 +34,8 @@ import "SuSEFirewall"; import "Linuxrc"; import "FileUtils"; +import "Installation"; +import "String"; global list<integer> newSources = []; @@ -1447,5 +1449,54 @@ } } + /** + * Finds the biggest temporary directory and uses it as + * packager download area. + */ + global void InstInitSourceMoveDownloadArea () { + map spaces = Pkg::TargetGetDU (); + list root_info = spaces["/tmp"]:spaces["/tmp/"]:spaces["/"]:[]; + integer total = root_info[0]:0; + integer current = root_info[1]:0; + integer future = root_info[2]:0; + if (future < current) + future = current; + integer tmp_space = total - future; + // no temp space left or read-only + if (tmp_space < 0 || root_info[3]:1 == 1) + tmp_space = 0; + + list var_info = spaces["/var/tmp"]:spaces["/var/tmp/"]:spaces["/var"]:spaces["/var/"]:spaces["/"]:[]; + total = var_info[0]:0; + current = var_info[1]:0; + future = var_info[2]:0; + if (future < current) + future = current; + integer var_tmp_space = total - future; + // no temp space left or read-only + if (var_tmp_space < 0 || var_info[3]:1 == 1) + var_tmp_space = 0; + + //------- + // /tmp or /var/tmp ? + + string download_dir = tmp_space > var_tmp_space + ? "/tmp" + : "/var/tmp"; + download_dir = Installation::destdir + download_dir; + integer space = tmp_space > var_tmp_space + ? tmp_space + : var_tmp_space; + if (true) // TODO check the size of the largest package on CD1 + { + integer successful = (integer) SCR::Execute (.target.bash, sformat ("test -d '%1' || mkdir '%1'", String::Quote (download_dir))); + if (successful == 0) { + Pkg::SourceMoveDownloadArea (download_dir); + } else { + y2error ("Unable to create %1 directory", download_dir); + } + } + } + /* EOF */ } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org