[yast-commit] r60594 - in /branches/SuSE-Code-11-SP1-Branch/update: VERSION package/yast2-update.changes src/clients/packages_proposal.ycp src/clients/update_proposal.ycp
![](https://seccdn.libravatar.org/avatar/2e1a2d7374f0eeb790839676bdd1123a.jpg?s=120&d=mm&r=g)
Author: locilka Date: Thu Jan 28 11:13:19 2010 New Revision: 60594 URL: http://svn.opensuse.org/viewcvs/yast?rev=60594&view=rev Log: - Counting packages directly in packages proposal (BNC #573482). - 2.17.19 Modified: branches/SuSE-Code-11-SP1-Branch/update/VERSION branches/SuSE-Code-11-SP1-Branch/update/package/yast2-update.changes branches/SuSE-Code-11-SP1-Branch/update/src/clients/packages_proposal.ycp branches/SuSE-Code-11-SP1-Branch/update/src/clients/update_proposal.ycp Modified: branches/SuSE-Code-11-SP1-Branch/update/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/update/VERSION?rev=60594&r1=60593&r2=60594&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/update/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/update/VERSION Thu Jan 28 11:13:19 2010 @@ -1 +1 @@ -2.17.18 +2.17.19 Modified: branches/SuSE-Code-11-SP1-Branch/update/package/yast2-update.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/update/package/yast2-update.changes?rev=60594&r1=60593&r2=60594&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/update/package/yast2-update.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/update/package/yast2-update.changes Thu Jan 28 11:13:19 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Jan 28 11:07:00 CET 2010 - locilka@suse.cz + +- Counting packages directly in packages proposal (BNC #573482). +- 2.17.19 + +------------------------------------------------------------------- Tue May 12 13:06:56 CEST 2009 - locilka@suse.cz - Removed copying inst-sys users to installed system during Modified: branches/SuSE-Code-11-SP1-Branch/update/src/clients/packages_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/update/src/clients/packages_proposal.ycp?rev=60594&r1=60593&r2=60594&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/update/src/clients/packages_proposal.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/update/src/clients/packages_proposal.ycp Thu Jan 28 11:13:19 2010 @@ -59,6 +59,46 @@ // SpaceCalculation::ShowPartitionWarning (); list<string> warning = SpaceCalculation::GetPartitionWarning (); + // Count statistics --> + // Pkg::GetPackages() + // `installed all installed packages + // `selected returns all selected but not yet installed packages + // `available returns all available packages (from the installation source) + // `removed all packages selected for removal + + // recreate the update summary + list<string> installed = Pkg::GetPackages (`installed, true); + list<string> selected = Pkg::GetPackages (`selected, true); + list<string> removed = Pkg::GetPackages (`removed, true); + integer cnt_installed = size (installed); + integer cnt_selected = size (selected); + integer cnt_removed = size (removed); + y2milestone ("Selected: %1, Installed: %2, Removed: %3", cnt_selected, cnt_installed, cnt_removed); + y2milestone("Removed: %1", removed); + + map<string,boolean> installed_m = listmap (string p, installed, { + return $[ p : true ]; + }); + map<string,boolean> selected_m = listmap (string p, selected, { + return $[ p : true ]; + }); + + // packages that are both 'installed' && 'selected' + Update::packages_to_update = size (filter (string p, selected, { + return haskey (installed_m, p); + })); + // packages that are 'selected' but not 'installed' + Update::packages_to_install = cnt_selected - Update::packages_to_update; + + // packages that are 'removed' but not 'selected again' + Update::packages_to_remove = size (filter (string p, removed, { + return ! haskey (selected_m, p); + })); + + y2milestone("Update statistics: Updated: %1, Installed: %2, Removed: %3", + Update::packages_to_update, Update::packages_to_install, Update::packages_to_remove); + // <-- Count statistics + list<string> tmp = []; // proposal for packages during update, %1 is count of packages Modified: branches/SuSE-Code-11-SP1-Branch/update/src/clients/update_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/update/src/clients/update_proposal.ycp?rev=60594&r1=60593&r2=60594&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/update/src/clients/update_proposal.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/update/src/clients/update_proposal.ycp Thu Jan 28 11:13:19 2010 @@ -304,43 +304,6 @@ Update::products_incompatible = true; } } - // Pkg::GetPackages() - // `installed all installed packages - // `selected returns all selected but not yet installed packages - // `available returns all available packages (from the installation source) - // `removed all packages selected for removal - - // recreate the update summary - list<string> installed = Pkg::GetPackages (`installed, true); - list<string> selected = Pkg::GetPackages (`selected, true); - list<string> removed = Pkg::GetPackages (`removed, true); - integer cnt_installed = size (installed); - integer cnt_selected = size (selected); - integer cnt_removed = size (removed); - y2milestone ("Selected: %1, Installed: %2, Removed: %3", cnt_selected, cnt_installed, cnt_removed); - y2milestone("Removed: %1", removed); - - map<string,boolean> installed_m = listmap (string p, installed, { - return $[ p : true ]; - }); - map<string,boolean> selected_m = listmap (string p, selected, { - return $[ p : true ]; - }); - - // packages that are both 'installed' && 'selected' - Update::packages_to_update = size (filter (string p, selected, { - return haskey (installed_m, p); - })); - // packages that are 'selected' but not 'installed' - Update::packages_to_install = cnt_selected - Update::packages_to_update; - - // packages that are 'removed' but not 'selected again' - Update::packages_to_remove = size (filter (string p, removed, { - return ! haskey (selected_m, p); - })); - - y2milestone("Update statistics: Updated: %1, Installed: %2, Removed: %3", - Update::packages_to_update, Update::packages_to_install, Update::packages_to_remove); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org