[yast-commit] r60090 - in /trunk/restore: package/yast2-restore.changes src/ui.ycp
Author: locilka Date: Mon Dec 14 11:16:38 2009 New Revision: 60090 URL: http://svn.opensuse.org/viewcvs/yast?rev=60090&view=rev Log: - Fixed restoration of unavailable packages (bnc #553400). - Fixed dialog for selecting packages to restore (bnc #553400). Modified: trunk/restore/package/yast2-restore.changes trunk/restore/src/ui.ycp Modified: trunk/restore/package/yast2-restore.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/restore/package/yast2-restore.changes?rev=60090&r1=60089&r2=60090&view=diff ============================================================================== --- trunk/restore/package/yast2-restore.changes (original) +++ trunk/restore/package/yast2-restore.changes Mon Dec 14 11:16:38 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Dec 14 11:12:13 CET 2009 - locilka@suse.cz + +- Fixed restoration of unavailable packages (bnc #553400). +- Fixed dialog for selecting packages to restore (bnc #553400). + +------------------------------------------------------------------- Wed Jun 24 15:49:19 CEST 2009 - locilka@suse.cz - Fixed 'Archive Properties' scrolling (bnc #459657). Modified: trunk/restore/src/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/restore/src/ui.ycp?rev=60090&r1=60089&r2=60090&view=diff ============================================================================== --- trunk/restore/src/ui.ycp (original) +++ trunk/restore/src/ui.ycp Mon Dec 14 11:16:38 2009 @@ -29,8 +29,10 @@ import "URL"; import "Popup"; +import "Report"; import "Label"; import "Package"; +import "PackageSystem"; import "Sequencer"; include "restore/helps.ycp"; @@ -1232,9 +1234,53 @@ y2milestone("install: %1", install); y2milestone("uninstall: %1", uninstall); + list <string> unavailable_packages = []; + + // Initialize the package manager (the same way it is used later) + // before checking for packages availability + PackageSystem::EnsureSourceInit(); + + // BNC #553400: Checking for all packages to install whether they are available + foreach (string one_package, install, { + // Package is not available - cannot be installed + if (Pkg::IsAvailable (one_package) != true) { + if (Popup::AnyQuestion ( + // Headline + _("Error"), + // Error message + sformat(_("Package %1 is not available on any of the subscribed repositories. +Would you like to got back and unselect the package or skip it?"), one_package), + _("Yes, Go &Back"), + _("&Skip"), + `focus_yes + )) { + y2milestone ("User has decided to go back an unselect the package (%1)", one_package); + lastret = `back; + break; + } else { + unavailable_packages = add (unavailable_packages, one_package); + y2warning ("User decided to skip missing package (%1)", one_package); + } + } + }); + + // Remove all unavailable packages from list of packages to install + foreach (string do_not_install_package, unavailable_packages, { + install = filter (string one_package, install, { + return (one_package != do_not_install_package); + }); + }); + + if (lastret == `back) + { + return `back; + } + if (size(install) > 0 || size(uninstall) > 0) { - Package::DoInstallAndRemove(install, uninstall); + if (Package::DoInstallAndRemove(install, uninstall) != true) { + Report::Error (_("Installation or removal of some packages has failed.")); + } Restore::ReadActualInstalledPackages(); } @@ -1367,7 +1413,11 @@ if (RPMoption == nil) { - RPMoption = (boolean) (proposedRPMrestoration["proposed"]:false); + // BNC #553400, Comment #19: Use the proposed 'Restore RPM DB' only if proposal is valid + if (haskey(proposedRPMrestoration, "proposed") && proposedRPMrestoration["proposed"]:false != nil) + RPMoption = (boolean) (proposedRPMrestoration["proposed"]:false); + else + RPMoption = false; } y2warning("RPMoption: %1", RPMoption); -- 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