Author: lslezak
Date: Fri Apr 18 14:45:14 2008
New Revision: 46836
URL: http://svn.opensuse.org/viewcvs/yast?rev=46836&view=rev
Log:
- Use Pkg::PkgMediaSizes() and Pkg::PkgMediaPackageSizes() for
computing total install and download size instead of quering
each selected package separately (speeds up the proposal summary
from 15-20 seconds to less than 1 second)
- this is also a workaround for broken disk usage in libzypp
(bnc#375104)
- 2.16.35
Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/src/modules/Packages.ycp
trunk/packager/yast2-packager.spec.in
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=46836&r1=46835&r2=46836&view=diff
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Fri Apr 18 14:45:14 2008
@@ -1 +1 @@
-2.16.34
+2.16.35
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=46836&r1=46835&r2=46836&view=diff
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Fri Apr 18 14:45:14 2008
@@ -1,4 +1,15 @@
-------------------------------------------------------------------
+Fri Apr 18 14:24:07 CEST 2008 - lslezak@suse.cz
+
+- Use Pkg::PkgMediaSizes() and Pkg::PkgMediaPackageSizes() for
+ computing total install and download size instead of quering
+ each selected package separately (speeds up the proposal summary
+ from 15-20 seconds to less than 1 second)
+- this is also a workaround for broken disk usage in libzypp
+ (bnc#375104)
+- 2.16.35
+
+-------------------------------------------------------------------
Wed Apr 16 13:37:41 CEST 2008 - locilka@suse.cz
- Using pattern-xfce for XFCE Desktop selection (bnc #377584).
Modified: trunk/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.ycp?rev=46836&r1=46835&r2=46836&view=diff
==============================================================================
--- trunk/packager/src/modules/Packages.ycp (original)
+++ trunk/packager/src/modules/Packages.ycp Fri Apr 18 14:45:14 2008
@@ -150,35 +150,48 @@
*/
global string CountSizeToBeInstalled () {
integer sz = 0;
- if (! Mode::installation () && !Installation::dirinstall_installing_into_dir )
- {
- list<string> packages = Pkg::GetPackages (`selected, true);
- foreach (string p, packages, {
- sz = sz + Pkg::PkgSize (p);
- });
- // convert into kB
- sz = sz / 1024;
- }
- else // in case of fresh installation, disk is initially empty
- {
- map media_sizes = Pkg::PkgMediaSizes();
+
+ foreach (list<integer> inst_sizes, media_sizes,
+ {
+ foreach (integer inst_size, inst_sizes,
+ {
+ sz = sz + inst_size;
+ }
+ );
+ }
+ );
+
+ y2milestone ("Total size of packages to install %1 (%2kB)", sz, sz / 1024 );
+ return String::FormatSizeWithPrecision (sz, 1, true);
+}
+
+map
media_sizes = Pkg::PkgMediaPackageSizes();
+ y2debug("Media sizes: %1", media_sizes);
- foreach (string p, packages,
+ foreach(integer repoid, remote_repos,
{
- list<map> properties = Pkg::ResolvableProperties(p, `package, "");
+ list<integer> repo_media_sizes = media_sizes[(repo_mapping[repoid]:-1) - 1]:[];
- foreach(map prop, properties,
+ foreach(integer media_size, repo_media_sizes,
{
- // the package is selected for installation
- if (prop["status"]:`unknown == `selected && contains(remote_repos, prop["source"]:-1))
- {
- y2debug("Found remote package %1-%2 (%3) from repository %4", p, prop["version"]:"", prop["download_size"]:0, prop["source"]:-1);
-
- ret = ret + prop["download_size"]:0;
- }
+ ret = ret + media_size;
}
);
}
);
- y2milestone("Total size of packages to download: %1 (%2 B)", String::FormatSizeWithPrecision(ret, 1, true), ret);
-
+ y2milestone("Total size of packages to download: %1 (%2kB)", ret, ret / 1024);
return ret;
}
Modified: trunk/packager/yast2-packager.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/yast2-packager.spec.in?rev=46836&r1=46835&r2=46836&view=diff
==============================================================================
--- trunk/packager/yast2-packager.spec.in (original)
+++ trunk/packager/yast2-packager.spec.in Fri Apr 18 14:45:14 2008
@@ -7,8 +7,8 @@
# empty package callbacks
BuildRequires: yast2 >= 2.16.52
-# new registration of callbacks
-BuildRequires: yast2-pkg-bindings >= 2.16.23
+# Pkg::PkgMediaPackageSizes()
+BuildRequires: yast2-pkg-bindings >= 2.16.29
# Module: OneClickInstallStandard
Requires: perl-XML-Bare yast2-perl-bindings
@@ -17,8 +17,8 @@
Requires: yast2-country-data >= 2.16.3
Requires: yast2-installation >= 2.15.12
-# new registration of callbacks
-Requires: yast2-pkg-bindings >= 2.16.23
+# Pkg::PkgMediaPackageSizes()
+Requires: yast2-pkg-bindings >= 2.16.29
# empty package callbacks
Requires: yast2 >= 2.16.52
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org