[yast-commit] r56457 - in /trunk/installation: VERSION control/control.openSUSE.xml package/yast2-installation.changes src/clients/inst_deploy_image.ycp src/modules/ImageInstallation.ycp

Author: locilka Date: Mon Mar 30 14:25:11 2009 New Revision: 56457 URL: http://svn.opensuse.org/viewcvs/yast?rev=56457&view=rev Log: - Fixing reevaluation of packages to remove, install and/or upgrade after images are deployed during first stage (bnc #489448). - 2.18.12 Modified: trunk/installation/VERSION trunk/installation/control/control.openSUSE.xml trunk/installation/package/yast2-installation.changes trunk/installation/src/clients/inst_deploy_image.ycp trunk/installation/src/modules/ImageInstallation.ycp Modified: trunk/installation/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/VERSION?rev=56457&r1... ============================================================================== --- trunk/installation/VERSION (original) +++ trunk/installation/VERSION Mon Mar 30 14:25:11 2009 @@ -1 +1 @@ -2.18.11 +2.18.12 Modified: trunk/installation/control/control.openSUSE.xml URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/control/control.open... ============================================================================== --- trunk/installation/control/control.openSUSE.xml (original) +++ trunk/installation/control/control.openSUSE.xml Mon Mar 30 14:25:11 2009 @@ -170,6 +170,9 @@ <!-- bnc #431259 --> <default_ntp_setup config:type="boolean">true</default_ntp_setup> + + <!-- to debug deploying, set to 'true' --> + <debug_deploying config:type="boolean">false</debug_deploying> </globals> <software> Modified: trunk/installation/package/yast2-installation.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-instal... ============================================================================== --- trunk/installation/package/yast2-installation.changes (original) +++ trunk/installation/package/yast2-installation.changes Mon Mar 30 14:25:11 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Mar 30 14:20:57 CEST 2009 - locilka@suse.cz + +- Fixing reevaluation of packages to remove, install and/or upgrade + after images are deployed during first stage (bnc #489448). +- 2.18.12 + +------------------------------------------------------------------- Fri Mar 27 18:15:15 CET 2009 - locilka@suse.cz - Added new globals->ac_redraw_and_ignore control file item Modified: trunk/installation/src/clients/inst_deploy_image.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_dep... ============================================================================== --- trunk/installation/src/clients/inst_deploy_image.ycp (original) +++ trunk/installation/src/clients/inst_deploy_image.ycp Mon Mar 30 14:25:11 2009 @@ -338,7 +338,10 @@ PackageCallbacks::RestorePreviousProgressCallbacks(); // Restore the states stored by StoreAllChanges() -ImageInstallation::RestoreAllChanges(); +if (ImageInstallation::RestoreAllChanges() != true) { + y2warning ("Aborting..."); + return `abort; +} // BNC #436842 - debug feature in control file if (ProductFeatures::GetBooleanFeature("globals", "debug_deploying") == true) { Modified: trunk/installation/src/modules/ImageInstallation.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/modules/ImageIns... ============================================================================== --- trunk/installation/src/modules/ImageInstallation.ycp (original) +++ trunk/installation/src/modules/ImageInstallation.ycp Mon Mar 30 14:25:11 2009 @@ -29,6 +29,7 @@ import "ProductControl"; import "ProductFeatures"; import "Packages"; +import "PackagesUI"; textdomain "installation"; @@ -1098,7 +1099,7 @@ boolean ret = nil; - // There are some installed + // There are some installed (matching the same arch, version, and name) if (size (resolvable_properties) > 0) { y2milestone ("Resolvable type: %1, name: %2 already installed", one_type, one_object["name"]:"-x-"); // Let's keep the installed version @@ -1118,7 +1119,12 @@ return ret; } - global void RestoreAllChanges () { + /** + * Restores packages statuses from 'objects_state': Selects packages for removal, installation, upgrade. + * + * @return boolean if successful + */ + global boolean RestoreAllChanges () { integer nr_steps = 4 * size (all_supported_types); string id = "restoring_user_prefs"; @@ -1139,6 +1145,11 @@ if (generic_set_progress != nil) generic_set_progress (id, nil); + // List of all packages selected for installation (just names) + list <string> selected_for_installation_pkgnames = maplist (map one_resolvable, objects_state[one_type, "install"]:[], { + return one_resolvable["name"]:""; + }); + // All packages selected to be installed // [ $[ "arch" : ... , "name" : ... , "version" : ... ], ... ] list <map <string, string> > selected_for_installation = maplist (map one_resolvable, objects_state[one_type, "install"]:[], { @@ -1162,9 +1173,17 @@ // Already installed resolvable but not in list of resolvables to be installed if (! contains (selected_for_installation, one_already_installed_resolvable)) { - y2milestone ("Removing type: %1, name: %2 version: %3", - one_type, one_resolvable["name"]:"-x-", one_resolvable["version"]:"-x-"); - Pkg::ResolvableRemove (one_resolvable["name"]:"-x-", one_type); + // BNC #489448: Do not remove package which is installed in different version and/or arch + // It will be upgraded later + if (contains (selected_for_installation_pkgnames, one_resolvable["name"]:"-x-")) { + y2milestone ("Not Removing type: %1, name: %2 version: %3", + one_type, one_resolvable["name"]:"-x-", one_resolvable["version"]:"-x-"); + // Package is installed or selected but should not be, remove it + } else { + y2milestone ("Removing type: %1, name: %2 version: %3", + one_type, one_resolvable["name"]:"-x-", one_resolvable["version"]:"-x-"); + Pkg::ResolvableRemove (one_resolvable["name"]:"-x-", one_type); + } } }); @@ -1182,6 +1201,43 @@ // Free the memory objects_state = $[]; + + // Return 'true' if YaST can solve deps. automatically + if (Pkg::PkgSolve (true) == true) { + y2milestone ("Dependencies solved atomatically"); + return true; + } + + // Error message + Report::Error (_("Installation was unable to solve package dependecies automatically. +Package manager will be opened for you to solve them manually.")); + + boolean ret = false; + + // BNC #Trying to solve deps. manually + while (true) { + y2warning ("Cannot solve dependecies automatically, opening Packages UI"); + symbol diaret = PackagesUI::RunPackageSelector ($["enable_repo_mgr":false, "mode":`summaryMode]); + y2milestone ("RunPackageSelector returned %1", diaret); + + // User didn't solve the deps manually + if (diaret == `cancel) { + ret = false; + if (Popup::ConfirmAbort (`unusable)) { + y2warning ("User abort..."); + break; + } + // Aborting not confirmed, next round + continue; + // Solved! (somehow) + } else { + ret = true; + break; + } + } + + y2milestone ("Dependencies solved: %1", ret); + return ret; } // <-- Storing and restoring states -- 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