Hello community, here is the log from the commit of package yast2-online-update checked in at Sat Apr 15 11:43:21 CEST 2006. -------- --- yast2-online-update/yast2-online-update.changes 2006-04-12 13:12:46.000000000 +0200 +++ NOARCH/yast2-online-update/yast2-online-update.changes 2006-04-14 14:32:37.000000000 +0200 @@ -1,0 +2,14 @@ +Fri Apr 14 14:21:24 CEST 2006 - jsuchome@suse.cz + +- install packagemanager related patches first, than restart yast + (#165540) +- skipped installation if no patch is selected (#163253) +- 2.13.25 + +------------------------------------------------------------------- +Fri Apr 14 13:14:12 CEST 2006 - visnov@suse.cz + +- initialize target before sources (#165849) +- 2.13.24 + +------------------------------------------------------------------- Old: ---- yast2-online-update-2.13.23.tar.bz2 New: ---- yast2-online-update-2.13.25.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-online-update.spec ++++++ --- /var/tmp/diff_new_pack.Z1tlF0/_old 2006-04-15 11:42:59.000000000 +0200 +++ /var/tmp/diff_new_pack.Z1tlF0/_new 2006-04-15 11:42:59.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-online-update (Version 2.13.23) +# spec file for package yast2-online-update (Version 2.13.25) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,12 +11,12 @@ # norootforbuild Name: yast2-online-update -Version: 2.13.23 +Version: 2.13.25 Release: 1 License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-online-update-2.13.23.tar.bz2 +Source0: yast2-online-update-2.13.25.tar.bz2 prefix: /usr BuildRequires: gcc-c++ libxcrypt-devel perl-XML-Writer pkg-config update-desktop-files yast2-bootloader yast2-devtools yast2-packager PreReq: grep sed @@ -45,7 +45,7 @@ gs@suse.de %prep -%setup -n yast2-online-update-2.13.23 +%setup -n yast2-online-update-2.13.25 %build %{prefix}/bin/y2tool y2autoconf @@ -114,6 +114,14 @@ %{prefix}/share/applications/YaST2/cd_update.desktop %changelog -n yast2-online-update +* Fri Apr 14 2006 - jsuchome@suse.cz +- install packagemanager related patches first, than restart yast + (#165540) +- skipped installation if no patch is selected (#163253) +- 2.13.25 +* Fri Apr 14 2006 - visnov@suse.cz +- initialize target before sources (#165849) +- 2.13.24 * Wed Apr 12 2006 - jsuchome@suse.cz - run online update in manual mode if requested in control file (#165503) - 2.13.23 ++++++ yast2-online-update-2.13.23.tar.bz2 -> yast2-online-update-2.13.25.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.23/VERSION new/yast2-online-update-2.13.25/VERSION --- old/yast2-online-update-2.13.23/VERSION 2006-04-12 11:34:33.000000000 +0200 +++ new/yast2-online-update-2.13.25/VERSION 2006-04-14 14:23:13.000000000 +0200 @@ -1 +1 @@ -2.13.23 +2.13.25 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.23/src/inst_you.ycp new/yast2-online-update-2.13.25/src/inst_you.ycp --- old/yast2-online-update-2.13.23/src/inst_you.ycp 2006-04-12 10:19:04.000000000 +0200 +++ new/yast2-online-update-2.13.25/src/inst_you.ycp 2006-04-14 11:58:43.000000000 +0200 @@ -7,14 +7,16 @@ textdomain "online-update"; - import "Mode"; - import "Internet"; - import "Wizard"; + import "Directory"; + import "FileUtils"; import "GetInstArgs"; - import "Popup"; + import "Internet"; + import "Mode"; + import "OnlineUpdateCallbacks"; import "PackageCallbacksInit"; + import "Popup"; import "ProductFeatures"; - import "OnlineUpdateCallbacks"; + import "Wizard"; /* Called backwards */ if(GetInstArgs::going_back()) @@ -126,21 +128,96 @@ // compute ResStatus::EstablishField Pkg::PkgEstablish (); - // select all Needed patches for installation - Pkg::ResolvablePreselectPatches (); - y2milestone("All available patches: %1", Pkg::ResolvableProperties("", `patch, "")); + string saved_path = Directory::vardir + "/selected_patches.ycp"; + integer selected = 0; + + // check if there exists saved selection of patches to be installed + 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; + }); + 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); + } + + // if no patch is selected, pre-select all security and recommended + if (selected < 1) + { + selected = Pkg::ResolvablePreselectPatches (`all); + y2milestone ("All preselected patches: %1", selected); + } - boolean ok = Pkg::PkgSolve (false); - if (!ok || ProductFeatures::GetBooleanFeature ("globals", "manual_online_update") || Hack ("ui")) + // run package selector to allow user interaction + if (!Pkg::PkgSolve (false) || + ProductFeatures::GetBooleanFeature("globals", "manual_online_update") || + Hack ("ui")) { UI::OpenDialog(`opt(`defaultsize), `PackageSelector(`id(`selector), `opt(`youMode)) ); - symbol ret = (symbol)UI::RunPkgSelection(`id(`selector) ); + symbol ret_sel = (symbol)UI::RunPkgSelection(`id(`selector) ); UI::CloseDialog(); + if (ret_sel == `cancel) + return `next; } + list<string> normal_patches = []; + boolean reboot_needed = false; + foreach (map patch, Pkg::ResolvableProperties("", `patch, ""), { + if (patch["status"]:`none == `selected) + { + y2milestone ("selected patch: %1", patch); + if (patch["affects_pkg_manager"]:false) + { + if (patch["reboot_needed"]:false) + ret = `reboot; + else if (ret != `reboot) + ret = `restart_yast; + } + else + { + normal_patches = add (normal_patches, patch["name"]:""); + // for this patch reboot would be needed, but still it is not + // clear if the patch will be installed in this run -> save info + if (patch["reboot_needed"]:false) + reboot_needed = true; + } + } + }); + + // unselect non-affects_pkg_manager patches and save them to file + // for later usage + if (ret != `auto && size (normal_patches) > 0) + { + foreach (string pname, normal_patches, { + Pkg::ResolvableNeutral (pname, `patch); + }); + SCR::Write (.target.ycp, saved_path, normal_patches); + } + // no packagemanager patch selected ... + if (ret == `auto) + { + // ... but there is a patch with "reboot_needed" flag (=probably kernel) + if (reboot_needed) + ret = `reboot; + // ... and nothing to install -> skip the installation at all + else if (normal_patches == []) + return `next; + } + + // install the patches - OnlineUpdateCallbacks::RegisterOnlineUpdateCallbacks(); + OnlineUpdateCallbacks::RegisterOnlineUpdateCallbacks(); WFM::call( "online_update_install" ); @@ -154,7 +231,8 @@ // of course it covers updated (one removed, another added) foreach (string p, yast2_packages, { if (! contains (new_yast2_packages, p)) - ret = `restart_yast; +// ret = `restart_yast; + y2internal ("yast package updated, current ret is %1", ret); }); list<string> new_kernel_packages = filter (string p, packages, { return substring (p, 0, 6) == "kernel"; @@ -163,10 +241,10 @@ // check for added kernels, covers updates foreach (string p, new_kernel_packages, { if (! contains (kernel_packages, p)) - ret = `reboot; +// ret = `reboot; + y2internal ("kernel updated, current ret is %1", ret); }); y2milestone ("Checking result: %1", ret); - // FIXME: In future, use the attribute from metadata if (ret == `reboot) { // message popup diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.23/src/online_update.ycp new/yast2-online-update-2.13.25/src/online_update.ycp --- old/yast2-online-update-2.13.23/src/online_update.ycp 2006-03-31 08:53:38.000000000 +0200 +++ new/yast2-online-update-2.13.25/src/online_update.ycp 2006-04-14 13:19:24.000000000 +0200 @@ -134,6 +134,9 @@ UI::CloseDialog (); return 1; } + + // initialize target to import all trusted keys (#165849) + Pkg::TargetInit( "/", false ); OnlineUpdateCallbacks::RefreshAllSources(); OnlineUpdateCallbacks::RegisterOnlineUpdateCallbacks(); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.23/src/online_update_select.ycp new/yast2-online-update-2.13.25/src/online_update_select.ycp --- old/yast2-online-update-2.13.23/src/online_update_select.ycp 2006-03-31 08:53:38.000000000 +0200 +++ new/yast2-online-update-2.13.25/src/online_update_select.ycp 2006-04-14 13:40:51.000000000 +0200 @@ -9,14 +9,45 @@ textdomain "online-update"; + import "Directory"; + import "FileUtils"; import "Wizard"; Pkg::SourceStartManager (true); - Pkg::TargetInit ("/",false); + // target already initialized in online_update.ycp Pkg::PkgEstablish(); - Pkg::ResolvablePreselectPatches(); + integer selected = 0; + string saved_path = Directory::vardir + "/selected_patches.ycp"; + + // check if there exists saved selection of patches to be installed + 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; + }); + 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); + } + + // if no patch is selected, pre-select all security and recommended + if (selected < 1) + { + selected = Pkg::ResolvablePreselectPatches (`all); + y2milestone ("All preselected patches: %1", selected); + } + UI::OpenDialog(`opt(`defaultsize), `PackageSelector(`id(`selector), `opt(`youMode)) ); symbol ret = (symbol)UI::RunPkgSelection(`id(`selector) ); @@ -26,6 +57,33 @@ y2debug( "RunPkgSelection returned '%1'", ret ); + boolean restart_yast = false; + list<string> normal_patches = []; + foreach (map patch, Pkg::ResolvableProperties("", `patch, ""), { + if (patch["status"]:`none == `selected) + { + if (patch["affects_pkg_manager"]:false) + restart_yast = true; + else + normal_patches = add (normal_patches, patch["name"]:""); + } + }); + + // unselect non-affects_pkg_manager patches and save them to file + // for later usage + if (restart_yast && size (normal_patches) > 0) + { + foreach (string pname, normal_patches, { + Pkg::ResolvableNeutral (pname, `patch); + }); + SCR::Write (.target.ycp, saved_path, normal_patches); + } + // no patch selected + if (!restart_yast && normal_patches == []) + { + ret = `cancel; + } + if ( ret == `cancel ) return `abort; else return `next; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...