Author: jsuchome Date: Thu Apr 24 13:16:31 2008 New Revision: 47025 URL: http://svn.opensuse.org/viewcvs/yast?rev=47025&view=rev Log: - warn user if there are selected patches not for package management, do not run solver silently (bnc#367057) - 2.16.12 Modified: trunk/online-update/VERSION trunk/online-update/package/yast2-online-update.changes trunk/online-update/src/online_update.ycp trunk/online-update/src/online_update_install.ycp trunk/online-update/src/online_update_select.ycp Modified: trunk/online-update/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/VERSION?rev=47025&r1=47024&r2=47025&view=diff ============================================================================== --- trunk/online-update/VERSION (original) +++ trunk/online-update/VERSION Thu Apr 24 13:16:31 2008 @@ -1 +1 @@ -2.16.11 +2.16.12 Modified: trunk/online-update/package/yast2-online-update.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/package/yast2-online-update.changes?rev=47025&r1=47024&r2=47025&view=diff ============================================================================== --- trunk/online-update/package/yast2-online-update.changes (original) +++ trunk/online-update/package/yast2-online-update.changes Thu Apr 24 13:16:31 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Apr 24 13:06:59 CEST 2008 - jsuchome@suse.cz + +- warn user if there are selected patches not for package management, + do not run solver silently (bnc#367057) +- 2.16.12 + +------------------------------------------------------------------- Tue Apr 15 14:01:30 CEST 2008 - jsuchome@suse.cz - merged texts from proofread Modified: trunk/online-update/src/online_update.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/src/online_update.ycp?rev=47025&r1=47024&r2=47025&view=diff ============================================================================== --- trunk/online-update/src/online_update.ycp (original) +++ trunk/online-update/src/online_update.ycp Thu Apr 24 13:16:31 2008 @@ -91,7 +91,7 @@ }); // continue/cancel message if (!is_available && Popup::YesNo (_("No active update repository available. -Exit <b>Online Update</b> now? +Exit Online Update now? "))) { Wizard::CloseDialog(); @@ -202,9 +202,10 @@ Popup::Message (OnlineUpdate::restart_message); } OnlineUpdate::restart_yast = false; - retval = -42;// restart menu.ycp even if there are no other patches selected + // restart menu.ycp even if there are no other patches selected + retval = -42; } - else if (OnlineUpdate::reboot_needed) + if (OnlineUpdate::reboot_needed) { Popup::Message (OnlineUpdate::reboot_message); } Modified: trunk/online-update/src/online_update_install.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/src/online_update_install.ycp?rev=47025&r1=47024&r2=47025&view=diff ============================================================================== --- trunk/online-update/src/online_update_install.ycp (original) +++ trunk/online-update/src/online_update_install.ycp Thu Apr 24 13:16:31 2008 @@ -56,12 +56,6 @@ if (!Stage::cont ()) Wizard::SetNextButton(`next, Label::FinishButton() ); - if (!Stage::cont ()) - { - Wizard::SetNextButton(`next, Label::FinishButton() ); - Pkg::PkgSolve (true); - } - integer total_progress = size (Pkg::GetPackages (`selected, true)) * 2; if (total_progress == 0) total_progress = 100; Modified: trunk/online-update/src/online_update_select.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/src/online_update_select.ycp?rev=47025&r1=47024&r2=47025&view=diff ============================================================================== --- trunk/online-update/src/online_update_select.ycp (original) +++ trunk/online-update/src/online_update_select.ycp Thu Apr 24 13:16:31 2008 @@ -47,28 +47,26 @@ Pkg::PkgEstablish(); + boolean restart_yast = false; + boolean reboot_needed = false; + boolean normal_patches_selected = false; integer selected = 0; string saved_path = Directory::vardir + "/selected_patches.ycp"; - // check if there exists saved selection of patches to be installed + // check if YaST was restarted if (FileUtils::Exists (saved_path)) { - list<string> patches = (list<string>) SCR::Read(.target.ycp,saved_path); - if (patches == nil) - patches = []; - foreach (string pname, patches, { - if (Pkg::ResolvableInstall (pname, `patch)) - selected = selected + 1; - }); + string saved = (string) SCR::Read (.target.ycp, saved_path); + // before restart, patch requiring reboot was installed: + // show the reboot popup now + if (saved != nil && is (saved, string) && saved == "reboot") + reboot_needed = true; SCR::Execute (.target.remove, saved_path); - y2milestone ("Previously selected patches: %1", selected); } + // if not, select the patches affecting pkg management - else - { - selected = Pkg::ResolvablePreselectPatches (`affects_pkg_manager); - y2milestone ("Preselected patches for pkg management: %1", selected); - } + selected = Pkg::ResolvablePreselectPatches (`affects_pkg_manager); + y2milestone ("Preselected patches for pkg management: %1", selected); // if no patch is selected, pre-select all security and recommended if (selected < 1) @@ -77,6 +75,8 @@ y2milestone ("All preselected patches: %1", selected); } + Wizard::ClearContents();// do not show the remnant of initial progress + boolean simple_mode = OnlineUpdate::simple_mode && (UI::HasSpecialWidget(`SimplePatchSelector) == true); if (simple_mode) { @@ -103,6 +103,34 @@ current = "simple"; ret = nil; } + if (ret == `accept) + { + restart_yast = false; + normal_patches_selected = false; + foreach (map patch, Pkg::ResolvableProperties ("", `patch, ""), { + if (patch["status"]:`none == `selected) + { + if (patch["affects_pkg_manager"]:false) + restart_yast = true; + else + normal_patches_selected = true; + } + }); + if (restart_yast && normal_patches_selected) + { + // continue/cancel popup + if (!Popup::ContinueCancel (_("There are patches for package management available requiring restart of YaST. +They should be installed first and all other patches after the restart. + +You selected some other patches to be installed now. + +Continue with installing your selection?"))) + { + ret = nil; + UI::OpenDialog (`opt(`defaultsize), `PackageSelector(`id(`selector), `opt(`youMode))); + } + } + } } until ( ret == `cancel || ret == `accept ); Wizard::ClearContents(); @@ -110,41 +138,45 @@ y2milestone ("RunPkgSelection finally returned '%1'", ret); if ( ret == `cancel ) return `abort; - boolean restart_yast = false; - list<string> normal_patches = []; boolean more_patches_needed = false; - boolean reboot_needed = false; foreach (map patch, Pkg::ResolvableProperties("", `patch, ""), { if (patch["status"]:`none == `selected) { if (patch["reboot_needed"]:false) reboot_needed = true; if (patch["affects_pkg_manager"]:false) - restart_yast = true; + restart_yast = true; else - normal_patches = add (normal_patches, patch["name"]:""); + normal_patches_selected = true; } - else if (patch["is_needed"]:false) // patch not selected: bug #188541 + // patch not selected: bug #188541 - touch saved_path to force the restart + else if (patch["is_needed"]:false) { - y2debug ("patch needed but not selected: %1", patch); + y2milestone ("patch needed but not selected: %1", patch); more_patches_needed = true; } }); - // unselect non-affects_pkg_manager patches and save them to file - // for later usage - if (restart_yast && (size (normal_patches) > 0 || more_patches_needed)) - { - foreach (string pname, normal_patches, { - Pkg::ResolvableNeutral (pname, `patch, true); - }); - SCR::Write (.target.ycp, saved_path, normal_patches); - // show reboot popup only when yast is not going to restart itself automatically + // tell the caller (/sbin/yast2) to call online update again + if (restart_yast && more_patches_needed) + { + // what if kernel (=reboot) and zypp (=restart) are installed together? + // => restart YaST and show reboot message after the second run + string save_message = "restart"; + if (reboot_needed) + save_message = "reboot"; + SCR::Write (.target.ycp, saved_path, save_message); + // show reboot popup only when yast is not going to restart now reboot_needed = false; } + else + { + y2debug ("nothing left for the second run, no restart needed"); + } + // no patch selected - if (!restart_yast && normal_patches == [] && !Pkg::PkgAnyToInstall () && - !Pkg::PkgAnyToDelete ()) + if (!restart_yast && !normal_patches_selected && + !Pkg::PkgAnyToInstall () && !Pkg::PkgAnyToDelete ()) { ret = `cancel; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org