Hello community, here is the log from the commit of package yast2-online-update checked in at Thu Aug 17 18:33:09 CEST 2006. -------- --- yast2-online-update/yast2-online-update.changes 2006-07-14 09:25:19.000000000 +0200 +++ yast2-online-update/yast2-online-update.changes 2006-08-17 14:55:57.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Aug 17 12:50:39 CEST 2006 - jsuchome@suse.cz + +- new callbacks for Patch and Delta RPMs (#168844) +- fixed generation of cron job: don't ask for confirmation (#194424) +- 2.13.45 + +------------------------------------------------------------------- Old: ---- yast2-online-update-2.13.44.tar.bz2 New: ---- yast2-online-update-2.13.45.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-online-update.spec ++++++ --- /var/tmp/diff_new_pack.M7HjU8/_old 2006-08-17 18:33:04.000000000 +0200 +++ /var/tmp/diff_new_pack.M7HjU8/_new 2006-08-17 18:33:04.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-online-update (Version 2.13.44) +# spec file for package yast2-online-update (Version 2.13.45) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,16 +11,17 @@ # norootforbuild Name: yast2-online-update -Version: 2.13.44 +Version: 2.13.45 Release: 1 License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-online-update-2.13.44.tar.bz2 +Source0: yast2-online-update-2.13.45.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 -Requires: yast2 yast2-pkg-bindings >= 2.13.88 +# progress callbacks for delta rpms +Requires: yast2 yast2-pkg-bindings >= 2.13.92 Provides: y2c_online_update yast2-config-online-update Obsoletes: y2c_online_update yast2-config-online-update Provides: yast2-trans-online-update y2t_online_update @@ -45,7 +46,7 @@ gs@suse.de %prep -%setup -n yast2-online-update-2.13.44 +%setup -n yast2-online-update-2.13.45 %build %{prefix}/bin/y2tool y2autoconf @@ -70,9 +71,14 @@ %post if [ -f /etc/cron.d/yast2-online-update ] ; then + cronjob=`grep "rug up -t patch" /etc/cron.d/yast2-online-update 2>/dev/null | grep -v "-y"` + if [ -n "$cronjob" ] ; then + # do not ask for confirmation + sed -e "s/rug up/rug up -y/" -i /etc/cron.d/yast2-online-update + fi cronjob=`grep "online_update" /etc/cron.d/yast2-online-update 2>/dev/null` if [ -n "$cronjob" ] ; then - sed -e "s/online_update/rug up -t patch/" -i /etc/cron.d/yast2-online-update + sed -e "s/online_update/rug up -y -t patch/" -i /etc/cron.d/yast2-online-update if [ "`echo "$cronjob" | grep -c " -g" 2>/dev/null`" -gt 0 ] ; then sed -e "s/ -g/ -d/" -i /etc/cron.d/yast2-online-update fi @@ -122,6 +128,10 @@ %{prefix}/share/applications/YaST2/cd_update.desktop %changelog -n yast2-online-update +* Thu Aug 17 2006 - jsuchome@suse.cz +- new callbacks for Patch and Delta RPMs (#168844) +- fixed generation of cron job: don't ask for confirmation (#194424) +- 2.13.45 * Wed Jul 12 2006 - jsuchome@suse.cz - fixed restart message after patching package management (#171546) - changed name in desktop file for automatic update config (#157871) ++++++ yast2-online-update-2.13.44.tar.bz2 -> yast2-online-update-2.13.45.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/VERSION new/yast2-online-update-2.13.45/VERSION --- old/yast2-online-update-2.13.44/VERSION 2006-07-14 08:45:17.000000000 +0200 +++ new/yast2-online-update-2.13.45/VERSION 2006-08-17 14:45:52.000000000 +0200 @@ -1 +1 @@ -2.13.44 +2.13.45 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/configure.in new/yast2-online-update-2.13.45/configure.in --- old/yast2-online-update-2.13.44/configure.in 2006-07-14 08:50:29.000000000 +0200 +++ new/yast2-online-update-2.13.45/configure.in 2006-08-11 09:50:49.000000000 +0200 @@ -1,6 +1,6 @@ dnl configure.in for yast2-online-update dnl -dnl -- This file is generated by y2autoconf 2.13.18 - DO NOT EDIT! -- +dnl -- This file is generated by y2autoconf 2.13.21 - DO NOT EDIT! -- dnl (edit configure.in.in instead) AC_INIT(yast2-online-update, 2.13.44, http://bugs.opensuse.org/, yast2-online-update) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/online-update.pot new/yast2-online-update-2.13.45/online-update.pot --- old/yast2-online-update-2.13.44/online-update.pot 2006-02-17 11:41:23.000000000 +0100 +++ new/yast2-online-update-2.13.45/online-update.pot 1970-01-01 01:00:00.000000000 +0100 @@ -1,298 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR SuSE Linux Products GmbH, Nuernberg -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-17 11:41+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: src/inst_you.ycp:32 -msgid "" -"YaST2\n" -"Initializing ..." -msgstr "" - -#. message popup -#: src/inst_you.ycp:105 -msgid "" -"The kernel has been updated. The system will\n" -"reboot now then continue the installation.\n" -msgstr "" - -#. message popup -#: src/inst_you.ycp:112 -msgid "" -"During online update, YaST was updated.\n" -"Finishing and restarting now." -msgstr "" - -#. popup message; 'rug' is name of command-line tool -#: src/online_update.ycp:17 -msgid "To install patches for your system in text mode, use the rug command." -msgstr "" - -#: src/online_update_install.ycp:44 -msgid "Progress Log" -msgstr "" - -#: src/online_update_install.ycp:46 -msgid "Patch Progress" -msgstr "" - -#: src/online_update_install.ycp:48 -msgid "Total Progress" -msgstr "" - -#: src/online_update_install.ycp:50 -msgid "&Remove Source Packages after Update" -msgstr "" - -#: src/online_update_install.ycp:57 -msgid "" -"<p>After connecting to the SuSE update server,\n" -"YaST2 will download all selected patches.\n" -"This could take some time. Download details are shown in the log window.</p>" -msgstr "" - -#: src/online_update_install.ycp:61 -msgid "" -"<p>When the download has finished successfully, the\n" -"patches will be installed. The progress is shown in the log window. If there\n" -"are special messages associated with patches, they will be shown in an\n" -"extra dialog when the patch is being installed.</p>\n" -msgstr "" - -#: src/online_update_install.ycp:67 -msgid "" -"<p>After patches are installed, the downloaded\n" -"data is no longer needed. To delete this data, activate \n" -"<b>Remove Source Packages after Update</b>.</p>\n" -msgstr "" - -#. using SetContents (define in online_update.ycp) -#: src/online_update_install.ycp:75 -msgid "Patch Download and Installation" -msgstr "" - -#: src/online_update_install.ycp:87 -msgid "Patch processing failed." -msgstr "" - -#: src/online_update_start.ycp:30 -msgid "&Username:" -msgstr "" - -#: src/online_update_start.ycp:40 -msgid "Authentication Data" -msgstr "" - -#: src/online_update_start.ycp:49 -msgid "&Password:" -msgstr "" - -#: src/online_update_start.ycp:53 -msgid "&Keep Authentication Data" -msgstr "" - -#: src/online_update_start.ycp:55 -msgid "&Clear Inputs" -msgstr "" - -#: src/online_update_start.ycp:57 -msgid "&Login" -msgstr "" - -#: src/online_update_start.ycp:107 -msgid "Retrieving information about new updates..." -msgstr "" - -#: src/online_update_start.ycp:151 -msgid "Authorization" -msgstr "" - -#: src/online_update_start.ycp:152 -msgid "Enter the registration data." -msgstr "" - -#: src/online_update_start.ycp:186 -msgid "User-Defined Location" -msgstr "" - -#: src/online_update_start.ycp:201 -msgid "Initializing for CD update..." -msgstr "" - -#: src/online_update_start.ycp:204 -#, ycp-format -msgid "Getting a list of mirror servers..." -msgstr "" - -#: src/online_update_start.ycp:220 -msgid "" -"Cannot fetch remote server list. Only user-defined patch\n" -"sources will be available.\n" -"\n" -"Possible solution:\n" -"Check network connection.\n" -msgstr "" - -#: src/online_update_start.ycp:227 -#, ycp-format -msgid "URL: %1" -msgstr "" - -#: src/online_update_start.ycp:230 -msgid "Unable to read server list from disk." -msgstr "" - -#: src/online_update_start.ycp:233 -msgid "Could not write server list to disk." -msgstr "" - -#: src/online_update_start.ycp:236 -msgid "Error getting servers." -msgstr "" - -#: src/online_update_start.ycp:258 -msgid "There was no update executed up to now." -msgstr "" - -#: src/online_update_start.ycp:260 -msgid "Last successful update was performed less than one day ago." -msgstr "" - -#: src/online_update_start.ycp:262 -#, ycp-format -msgid "Last successful update was performed %1 day ago." -msgid_plural "Last successful update was performed %1 days ago." -msgstr[0] "" -msgstr[1] "" - -#: src/online_update_start.ycp:294 -msgid "System &Information" -msgstr "" - -#: src/online_update_start.ycp:302 -#, ycp-format -msgid "Product: %1" -msgstr "" - -#: src/online_update_start.ycp:306 -#, ycp-format -msgid "Version: %1" -msgstr "" - -#: src/online_update_start.ycp:321 -msgid "Update Configuration" -msgstr "" - -#: src/online_update_start.ycp:327 -msgid "&Installation source" -msgstr "" - -#: src/online_update_start.ycp:332 -msgid "Location" -msgstr "" - -#: src/online_update_start.ycp:337 -msgid "New Server..." -msgstr "" - -#: src/online_update_start.ycp:338 -msgid "Edit Server..." -msgstr "" - -#: src/online_update_start.ycp:344 -msgid "&Manually Select Patches" -msgstr "" - -#: src/online_update_start.ycp:348 -msgid "&Reload All Patches from Server" -msgstr "" - -#: src/online_update_start.ycp:353 -msgid "&Configure Fully Automatic Update..." -msgstr "" - -#. helptext dialog online update start screen -#: src/online_update_start.ycp:367 -msgid "" -"<p>YaST Online Update (YOU) is the easy way to get all recommended\n" -"patches and security fixes from a SuSE update server.\n" -"</p>\n" -msgstr "" - -#: src/online_update_start.ycp:372 -msgid "" -"<p>\n" -"If <b>Manually Select Patches</b> is checked, all available patches will be shown\n" -"from which to select the patches to install.<br>\n" -"If <b>Reload All Patches from Server</b> is checked, all patches will be fetched\n" -"from the server even when they already are locally available from a previous\n" -"download.\n" -"</p>\n" -msgstr "" - -#: src/online_update_start.ycp:381 -msgid "" -"<p>After clicking <b>New Server</b>, select a local\n" -"installation source instead of an FTP or HTTP server or select\n" -"another FTP or HTTP server. Click <b>Edit Server</b> to edit the location of the\n" -"selected server.</p>\n" -msgstr "" - -#: src/online_update_start.ycp:387 -msgid "" -"<p>Clicking <b>Configure Fully Automatic Update</b>\n" -"opens a dialog in which to configure YOU to check for updates once a day\n" -"and automatically download and install updates when new ones are available\n" -"without the need of user interaction.</p>\n" -msgstr "" - -#: src/online_update_start.ycp:395 -msgid "Welcome to YaST Online Update" -msgstr "" - -#: src/online_update_start.ycp:490 -msgid "" -"Login failed. Check that you have provided\n" -"the correct user name and password.\n" -msgstr "" - -#: src/online_update_start.ycp:495 -msgid "" -"Initialization failed. Check that\n" -"you have inserted the correct CD.\n" -msgstr "" - -#: src/online_update_start.ycp:500 -msgid "" -"Initialization failed. Try again.\n" -"If failure continues, choose\n" -"another SuSE FTP/HTTP server.\n" -msgstr "" - -#: src/online_update_start.ycp:507 -msgid "" -"Signature check for patch info files failed.\n" -"Cannot load patch information.\n" -msgstr "" - -#: src/online_update_start.ycp:514 -msgid "URL is invalid." -msgstr "" - -#: src/online_update_start.ycp:516 -msgid "Patch information retrieval failed." -msgstr "" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/src/AutoOnlineUpdate.ycp new/yast2-online-update-2.13.45/src/AutoOnlineUpdate.ycp --- old/yast2-online-update-2.13.44/src/AutoOnlineUpdate.ycp 2006-06-29 14:28:31.000000000 +0200 +++ new/yast2-online-update-2.13.45/src/AutoOnlineUpdate.ycp 2006-08-17 14:45:06.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Data for configuration of AutoOnlineUpdate, input and output functions. * Authors: Anas Nashif <nashif@suse.de> * - * $Id: AutoOnlineUpdate.ycp 29650 2006-04-04 11:28:28Z jsuchome $ + * $Id: AutoOnlineUpdate.ycp 32404 2006-08-17 12:46:41Z jsuchome $ * * Representation of the configuration of AutoOnlineUpdate. * Input and output routines. @@ -164,10 +164,10 @@ string cronjob = ""; if (timing == `weekly && day >= 0 && day <= 7) { - cronjob = sformat( "%1 %2 * * %3 root rug up -t patch %4", minute, hour, + cronjob = sformat( "%1 %2 * * %3 root rug up -y -t patch %4", minute, hour, day, options ); } else { - cronjob = sformat( "%1 %2 * * * root rug up -t patch %3", minute, hour, + cronjob = sformat( "%1 %2 * * * root rug up -y -t patch %3", minute, hour, options ); } if ( autoget ) cronjob = cronjob + " -d"; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/src/OnlineUpdateCallbacks.ycp new/yast2-online-update-2.13.45/src/OnlineUpdateCallbacks.ycp --- old/yast2-online-update-2.13.44/src/OnlineUpdateCallbacks.ycp 2006-07-11 14:24:42.000000000 +0200 +++ new/yast2-online-update-2.13.45/src/OnlineUpdateCallbacks.ycp 2006-08-17 14:44:49.000000000 +0200 @@ -1,9 +1,9 @@ /** - * Module: OnlineUpdateCallbacks.ycp + * Module: OnlineUpdateCallbacks.ycp * * Authors: Cornelius Schumacher <cschum@suse.de> * - * Purpose: provides the Callbacks for the online update + * Purpose: provides the Callbacks for the online update */ { module "OnlineUpdateCallbacks"; @@ -19,34 +19,20 @@ // if user aborted the installation boolean aborted = false; - /** - Callback for YOU progress widget. - */ - global define boolean ProgressCallback( integer num ) - ``{ - y2debug("ProgressCallback %1", num); + // last callback called + string last_callback = ""; - if ( UI::WidgetExists( `id( `progress ) ) ) { - UI::ChangeWidget( `id( `progress ), `Value, num ); - } - if (aborted) return false; - - symbol ret = (symbol)UI::PollInput(); + // indentation of subtasks progress reports + string indent = " "; - if ((ret == `abort || ret == `cancel) && - OnlineUpdateDialogs::ConfirmAbortUpdate (`incomplete)) { - aborted = true; - return false; - } + /** + * Callback for patch (resp. delta rpm) progress widget. + * @param num position of progress widget (0 to 100) + */ + global define boolean PatchProgressCallback (integer num) { - return true; - } + last_callback = "PatchProgressCallback"; - /** - Callback for YOU patch progress widget. - */ - global define boolean PatchProgressCallback (integer num) - ``{ y2debug("PatchProgressCallback %1", num); if ( UI::WidgetExists( `id( `patchprogress ) ) ) { @@ -62,38 +48,13 @@ aborted = true; return false; } - return true; } - global define string ErrorCallback( string type, string text, - string details ) - ``{ - y2milestone ("ErrorCallback %1, type: %2", text, type); - - if ( type == "skip" ) { - symbol proceed = OnlineUpdateDialogs::SkipPopup( text, details ); - if ( proceed == `abort ) return "abort"; - else if ( proceed == `tryagain ) return "retry"; - else if ( proceed == `skip ) return "skip"; - else if ( proceed == `all ) return "skipall"; - else if ( proceed == `ok ) return ""; - else return "error"; - } else if ( type == "abort" ) { - if ( OnlineUpdateDialogs::ConfirmAbortUpdate( `incomplete ) ) return "abort"; - else return ""; - } else { - string msg = text; - if ( size( details ) > 0 ) msg = msg + "\n" + details; - Popup::Error( msg ); - return "error"; - } - - return ""; - } - global void MessageCallback( string patchname, string patchsummary, string message ) { + last_callback = "MessageCallback"; + // handle all messages as post (OK only) list<map> patches = [ $[ @@ -106,9 +67,11 @@ OnlineUpdateDialogs::MessagePopup( patches, false ); } - global define void LogCallback( string text ) - ``{ - y2milestone( "LogCallback %1", text ); + /** + * add a text to the installation progress log + */ + global define void ProgressLog (string text) { + y2debug ("ProgressLog %1", text); if ( UI::WidgetExists( `id( `log ) ) ) { UI::ChangeWidget( `id( `log ), `LastLine, text ); @@ -120,8 +83,8 @@ */ global define boolean ExecuteYcpScriptCallback( string script ) ``{ -// y2milestone("ExecuteYcpScriptCallback"); - + last_callback = "ExecuteYcpScriptCallback"; + y2milestone("ExecuteYcpScriptCallback"); return (boolean)WFM::call( script, [] ); } @@ -130,23 +93,31 @@ */ global define boolean ScriptProgressCallback( integer percent ) ``{ -// y2milestone("ScriptProgressCallback"); - + last_callback = "ScriptProgressCallback"; + y2milestone("ScriptProgressCallback"); symbol ret = (symbol)UI::PollInput(); if ( ret == `abort || ret == `cancel ) { return false; } - return true; } /** Callback for starting download of a package. */ - global boolean StartProvide(string name, integer archivesize, boolean remote) + global boolean StartProvide(string name, integer archivesize,boolean remote) { - LogCallback( sformat( _("Retrieving %1..."), name ) ); + // progress log item (%1 is name of package) + ProgressLog (sformat (_("Retrieving %1..."), name)); + if (UI::WidgetExists (`id (`patchprogress))) + { + UI::ChangeWidget (`id (`patchprogress), `Label, + // progress bar label + _("Package Download Progress")); + UI::ChangeWidget (`id (`patchprogress), `Value, 0); + } + last_callback = "StartProvide"; return true; } @@ -156,16 +127,27 @@ global boolean StartPackage(string name, string summary, integer installsize, boolean is_delete) { - LogCallback( sformat( _("Installing %1: "%2" "), name, summary ) ); + // progress log item (%1 is name of package, %2 is summary) + ProgressLog( sformat( _("Installing %1: "%2" "), name, summary ) ); + if (UI::WidgetExists (`id (`patchprogress))) + { + UI::ChangeWidget (`id (`patchprogress), `Label, + // progress bar label + _("Package Installation Progress")); + UI::ChangeWidget (`id (`patchprogress), `Value, 0); + } + last_callback = "StartPackage"; return true; } - /** - Callback for finishing an action in the log + /** + * Callback for finishing an action in the log + * @param line true if we are adding to the end of line */ - global boolean FinishLine() + global boolean FinishLine (boolean line) { - LogCallback( _("OK") + "\n" ); + // progress log item (=previous action finished correctly) + ProgressLog ((line ? indent : "") + _("OK") + "\n" ); return true; } @@ -181,12 +163,13 @@ string ret = PackageCallbacks::DonePackage (error, reason); if (ret == "") { - FinishLine (); + FinishLine (true); total_progress = total_progress + 1; if ( UI::WidgetExists( `id( `progress ) ) ) { UI::ChangeWidget( `id( `progress ), `Value, total_progress); } } + last_callback = "DonePackage"; return ret; } @@ -201,16 +184,144 @@ string ret = PackageCallbacks::DoneProvide (error, reason, name); if (ret == "") { - FinishLine (); + if (last_callback == "StartProvide") + FinishLine (false); total_progress = total_progress + 1; if ( UI::WidgetExists( `id( `progress ) ) ) { UI::ChangeWidget( `id( `progress ), `Value, total_progress); } } + last_callback = "DoneProvide"; + return ret; + } + + /** + * callback for start of delta download + */ + global void StartDeltaDownload (string name, integer download_size) { + + // progress log item (%1 is name of delta RPM + if (last_callback == "StartProvide") + ProgressLog ("\n" + indent); + ProgressLog (sformat(_("Downloading delta RPM %1"), name)); + if (UI::WidgetExists (`id (`patchprogress))) + { + UI::ChangeWidget (`id (`patchprogress), `Label, + // progress bar label + _("Delta RPM Download Progress")); + UI::ChangeWidget (`id (`patchprogress), `Value, 0); + } + last_callback = "StartDeltaDownload"; + } + + /** + * callback for delta download progress + * @return boolean abort the download? + */ + global boolean ProgressDeltaDownload (integer num) { + + y2debug ("ProgressDeltaDownload %1", num); + boolean ret = PatchProgressCallback (num); + last_callback = "ProgressDeltaDownload"; return ret; } /** + * callback for problem during downloading delta + */ + global void ProblemDeltaDownload (string description) { + y2debug ("ProblemDeltaDownload: %1", description); + ProgressLog ( + "\n" + indent + + // progress log item (previous action failed(%1 is reason) + sformat(_("Failed to download delta RPM: %1"), description) + + "\n" + ); + last_callback = "ProblemDeltaDownload"; + } + + /* + * callback for start of applying delta rpm + */ + global void StartDeltaApply (string name) { + // progress log item (%1 is name of delta RPM) + ProgressLog (indent + sformat(_("Applying delta RPM: %1"), name)); + if (UI::WidgetExists (`id (`patchprogress))) + { + UI::ChangeWidget (`id (`patchprogress), `Label, + // progress bar label + _("Delta RPM Application Progress")); + UI::ChangeWidget (`id (`patchprogress), `Value, 0); + } + last_callback = "StartDeltaApply"; + } + + /** + * progress of applying delta + * (cannot be aborted) + */ + global void ProgressDeltaApply (integer num) { + y2debug ("ProgressDeltaApply: %1", num); + if (UI::WidgetExists (`id (`patchprogress))) { + UI::ChangeWidget (`id (`patchprogress), `Value, num); + } + last_callback = "ProgressDeltaApply"; + } + + /** + * callback for problem during aplying delta + */ + global void ProblemDeltaApply (string description) { + y2debug ("ProblemDeltaAply: %1", description); + ProgressLog ( + "\n" + indent + + // progress log item (previous action failed(%1 is reason) + sformat(_("Failed to apply delta RPM: %1"), description) + + "\n" + ); + last_callback = "ProblemDeltaApply"; + } + + /** + * callback for start of downloading patch + */ + global void StartPatchDownload (string name, integer download_size) { + + // progress log item (%1 is name of delta RPM) + if (last_callback == "StartProvide") + ProgressLog ("\n" + indent); + ProgressLog (sformat(_("Downloading patch RPM %1"), name)); + if (UI::WidgetExists (`id (`patchprogress))) + { + UI::ChangeWidget (`id (`patchprogress), `Label, + // progress bar label + _("Patch RPM Download Progress")); + UI::ChangeWidget (`id (`patchprogress), `Value, 0); + } + last_callback = "StartPatchDownload"; + } + + /** + * callback for problem during aplying delta + */ + global void ProblemPatchDownload (string description) { + y2debug ("ProblemPatchDownload: %1", description); + ProgressLog ( + "\n" + indent + + // progress log item (previous action failed(%1 is reason) + sformat(_("Failed to download patch RPM: %1"), description) + + "\n" + ); + last_callback = "ProblemPatchDownload"; + } + + // finish of download/application of delta or patch download + global void FinishPatchDeltaProvide () { + FinishLine (true); + last_callback = "FinishPatchDeltaProvide"; + } + + /** Constructor */ global define void RegisterOnlineUpdateCallbacks() @@ -227,14 +338,29 @@ Pkg::CallbackResolvableReport ("OnlineUpdateCallbacks::MessageCallback"); - Pkg::CallbackYouProgress ("OnlineUpdateCallbacks::ProgressCallback"); - Pkg::CallbackYouPatchProgress ("OnlineUpdateCallbacks::PatchProgressCallback"); - Pkg::CallbackYouError ("OnlineUpdateCallbacks::ErrorCallback"); - Pkg::CallbackYouLog ("OnlineUpdateCallbacks::LogCallback"); + Pkg::CallbackMediaChange ("PackageCallbacks::MediaChange"); + + // delta download + Pkg::CallbackStartDeltaDownload ("OnlineUpdateCallbacks::StartDeltaDownload"); + Pkg::CallbackProgressDeltaDownload ("OnlineUpdateCallbacks::ProgressDeltaDownload"); + Pkg::CallbackProblemDeltaDownload ("OnlineUpdateCallbacks::ProblemDeltaDownload"); + Pkg::CallbackFinishDeltaDownload ("OnlineUpdateCallbacks::FinishPatchDeltaProvide"); + + // delta application + Pkg::CallbackStartDeltaApply ("OnlineUpdateCallbacks::StartDeltaApply"); + Pkg::CallbackProgressDeltaApply ("OnlineUpdateCallbacks::ProgressDeltaApply"); + Pkg::CallbackProblemDeltaApply ("OnlineUpdateCallbacks::ProblemDeltaApply"); + Pkg::CallbackFinishDeltaApply ("OnlineUpdateCallbacks::FinishPatchDeltaProvide"); + + // patch download + Pkg::CallbackStartPatchDownload ("OnlineUpdateCallbacks::StartPatchDownload"); + Pkg::CallbackProgressPatchDownload ("OnlineUpdateCallbacks::ProgressPatchDownload"); + Pkg::CallbackProblemPatchDownload ("OnlineUpdateCallbacks::ProblemPatchDownload"); + Pkg::CallbackFinishPatchDownload ("OnlineUpdateCallbacks::FinishPatchDeltaProvide"); + + // obsoleted callbacks Pkg::CallbackYouExecuteYcpScript ("OnlineUpdateCallbacks::ExecuteYcpScriptCallback"); Pkg::CallbackYouScriptProgress ("OnlineUpdateCallbacks::ScriptProgressCallback"); - - Pkg::CallbackMediaChange ("PackageCallbacks::MediaChange"); } /* @@ -263,4 +389,21 @@ }); y2milestone ("... refreshing done"); } + + /** + * Refresh sources given by argument + */ + global define void RefreshSources (list<map> sources) { + y2milestone("Refreshing sources..."); + foreach (map one_source, sources, { + integer source_id = (integer) one_source["SrcId"]:nil; + boolean source_autorefresh = (boolean) one_source["autorefresh"]:true; + boolean source_enabled = (boolean) one_source["enabled"]:true; + if (source_id != nil && source_autorefresh == true && source_enabled == true) { + y2milestone("Refreshing source: %1", source_id); + Pkg::SourceRefreshNow(source_id); + } + }); + y2milestone ("... refreshing done"); + } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.13.44/src/online_update_install.ycp new/yast2-online-update-2.13.45/src/online_update_install.ycp --- old/yast2-online-update-2.13.44/src/online_update_install.ycp 2006-07-14 09:24:45.000000000 +0200 +++ new/yast2-online-update-2.13.45/src/online_update_install.ycp 2006-08-17 14:45:06.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: YOU installation page * Authors: Cornelius Schumacher <cschum@suse.de> * - * $Id: online_update_install.ycp 31838 2006-07-14 07:26:15Z jsuchome $ + * $Id: online_update_install.ycp 32404 2006-08-17 12:46:41Z jsuchome $ * * This is a client for installation. * It displays the dialog with a progress of the actual installation and @@ -27,7 +27,7 @@ `LogView(`id(`log), _("Progress Log"), 5, 0 ), `VSpacing( 0.5 ), // progress bar label - `ProgressBar( `id( `patchprogress ), _("Patch Progress") ), + `ProgressBar( `id( `patchprogress ), _("Package Progress") ), `VSpacing( 0.2 ), `ReplacePoint (`id(`rpprogress), // progress bar label @@ -58,6 +58,7 @@ Wizard::SetNextButton(`next, Label::FinishButton() ); Pkg::PkgSolve (true); + integer total_progress = size (Pkg::GetPackages (`selected, true)) * 2; if (total_progress == 0) total_progress = 100; @@ -75,7 +76,7 @@ import "OnlineUpdateCallbacks"; // progress information - OnlineUpdateCallbacks::LogCallback( _("Installation finished.\n") ); + OnlineUpdateCallbacks::ProgressLog (_("Installation finished.\n")); if ( commit[1]:[] != [] ) { string details = Pkg::LastError() + "\n" + Pkg::LastErrorDetails(); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org