Hello community,
here is the log from the commit of package yast2-online-update
checked in at Fri May 4 11:03:27 CEST 2007.
--------
--- yast2-online-update/yast2-online-update.changes 2007-04-26 15:37:09.000000000 +0200
+++ /mounts/work_src_done/NOARCH/yast2-online-update/yast2-online-update.changes 2007-05-04 10:58:21.217032000 +0200
@@ -1,0 +2,6 @@
+Fri May 4 10:47:39 CEST 2007 - jsuchome@suse.cz
+
+- added command line support for Automatic Online Update (#269901)
+- 2.15.12
+
+-------------------------------------------------------------------
Old:
----
yast2-online-update-2.15.11.tar.bz2
New:
----
yast2-online-update-2.15.12.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-online-update.spec ++++++
--- /var/tmp/diff_new_pack.Kg4069/_old 2007-05-04 11:00:44.000000000 +0200
+++ /var/tmp/diff_new_pack.Kg4069/_new 2007-05-04 11:00:44.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-online-update (Version 2.15.11)
+# spec file for package yast2-online-update (Version 2.15.12)
#
# Copyright (c) 2007 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.15.11
+Version: 2.15.12
Release: 1
License: GNU General Public License (GPL)
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-online-update-2.15.11.tar.bz2
+Source0: yast2-online-update-2.15.12.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
@@ -48,7 +48,7 @@
gs@suse.de
%prep
-%setup -n yast2-online-update-2.15.11
+%setup -n yast2-online-update-2.15.12
%build
%{prefix}/bin/y2tool y2autoconf
@@ -143,6 +143,9 @@
%ghost %{prefix}/share/applications/YaST2/cd_update.desktop
%changelog
+* Fri May 04 2007 - jsuchome@suse.cz
+- added command line support for Automatic Online Update (#269901)
+- 2.15.12
* Thu Apr 26 2007 - jsuchome@suse.cz
- fixed obsolete help text (#267960)
- 2.15.11
++++++ yast2-online-update-2.15.11.tar.bz2 -> yast2-online-update-2.15.12.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.15.11/src/AutoOnlineUpdate.ycp new/yast2-online-update-2.15.12/src/AutoOnlineUpdate.ycp
--- old/yast2-online-update-2.15.11/src/AutoOnlineUpdate.ycp 2007-01-31 15:39:02.000000000 +0100
+++ new/yast2-online-update-2.15.12/src/AutoOnlineUpdate.ycp 2007-05-04 10:39:09.000000000 +0200
@@ -4,7 +4,7 @@
* Summary: Data for configuration of AutoOnlineUpdate, input and output functions.
* Authors: Anas Nashif
*
- * $Id: AutoOnlineUpdate.ycp 35742 2007-01-31 14:39:00Z jsuchome $
+ * $Id: AutoOnlineUpdate.ycp 37813 2007-05-03 14:07:03Z jsuchome $
*
* Representation of the configuration of AutoOnlineUpdate.
* Input and output routines.
@@ -112,7 +112,8 @@
_("Wednesday"),
_("Thursday"),
_("Friday"),
- _("Saturday")
+ _("Saturday"),
+ _("Sunday")
];
/**
@@ -161,6 +162,7 @@
srandom();
if ( hour == -1 ) hour = random( 24 );
if ( minute == -1 ) minute = random( 60 );
+ random_time = true;
}
y2milestone("hour: %1, minutes: %2", hour, minute );
return true;
@@ -173,6 +175,11 @@
*/
global define boolean Write()
{
+ if (!enabled)
+ {
+ SCR::Execute( .target.remove, cronfile );
+ return true;
+ }
string cronjob = "";
if (updater != "rug" && updater != "zypper")
@@ -323,5 +330,32 @@
return $[ "install": required_packages , "remove":[] ];
}
+/**
+ * Check if update application (zypper/rug) is installed and install it if it is not
+ * @return false if application was not installed
+ */
+global boolean InstallUpdater () {
+
+ if (Package::Installed (updater))
+ return true;
+
+ string to_install = "";
+ if (Package::Installed ("zypper"))
+ updater = "zypper";
+ else if (Package::Installed ("zmd"))
+ // rug is default if zmd is present
+ to_install = "rug";
+ else
+ to_install = "zypper";
+ if (to_install != "")
+ {
+ if (Package::Install (to_install))
+ updater = to_install;
+ else // installation failed/canceled
+ return false;
+ }
+ return true;
+}
+
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.15.11/src/OnlineUpdateDialogs.ycp new/yast2-online-update-2.15.12/src/OnlineUpdateDialogs.ycp
--- old/yast2-online-update-2.15.11/src/OnlineUpdateDialogs.ycp 2007-02-01 10:03:54.000000000 +0100
+++ new/yast2-online-update-2.15.12/src/OnlineUpdateDialogs.ycp 2007-05-04 10:34:37.000000000 +0200
@@ -221,27 +221,11 @@
if ( ret == `next) {
if ( enabled )
{
- if (!Package::Installed (AutoOnlineUpdate::updater))
+ if (!AutoOnlineUpdate::InstallUpdater ())
{
- string to_install = "";
- if (Package::Installed ("zypper"))
- AutoOnlineUpdate::updater = "zypper";
- else if (Package::Installed ("zmd"))
- // rug is default if zmd is present
- to_install = "rug";
- else
- to_install = "zypper";
- if (to_install != "")
- {
- if (Package::Install (to_install))
- AutoOnlineUpdate::updater = to_install;
- else // installation failed/canceled
- {
- ret = `enable;
- UI::ChangeWidget( `id( `enable ), `Value, false);
- continue;
- }
- }
+ ret = `enable;
+ UI::ChangeWidget( `id( `enable ), `Value, false);
+ continue;
}
AutoOnlineUpdate::minute = (integer)UI::QueryWidget( `id( `minute ), `Value );
AutoOnlineUpdate::hour = (integer)UI::QueryWidget( `id( `hour ), `Value );
@@ -260,7 +244,7 @@
// busy popup text
Popup::ShowFeedback ("", _("Writing settings..."));
AutoOnlineUpdate::Write();
- sleep (2000);
+ sleep (1500);
Popup::ClearFeedback ();
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.15.11/src/online_update_install.ycp new/yast2-online-update-2.15.12/src/online_update_install.ycp
--- old/yast2-online-update-2.15.11/src/online_update_install.ycp 2007-04-26 15:28:27.000000000 +0200
+++ new/yast2-online-update-2.15.12/src/online_update_install.ycp 2007-04-26 15:36:23.000000000 +0200
@@ -4,7 +4,7 @@
* Summary: YOU installation page
* Authors: Cornelius Schumacher
*
- * $Id: online_update_install.ycp 36312 2007-02-20 13:39:23Z jsuchome $
+ * $Id: online_update_install.ycp 37741 2007-04-26 13:37:11Z jsuchome $
*
* This is a client for installation.
* It displays the dialog with a progress of the actual installation and
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.15.11/src/online_update_setup.ycp new/yast2-online-update-2.15.12/src/online_update_setup.ycp
--- old/yast2-online-update-2.15.11/src/online_update_setup.ycp 2006-08-22 15:48:49.000000000 +0200
+++ new/yast2-online-update-2.15.12/src/online_update_setup.ycp 2007-05-04 10:57:45.000000000 +0200
@@ -1,12 +1,228 @@
/**
* Package: Online update
- * Summary: Open a dialog for configuarion of automatic update
+ * Summary: Configuarion of automatic update
* Authors: Jiri Suchomel
*
* $Id$
*/
{
+ textdomain "online-update";
+
+ import "AutoOnlineUpdate";
+ import "CommandLine";
+ import "Mode";
import "OnlineUpdateDialogs";
+ import "Popup";
+
+ /**
+ * command line handler for modifications
+ */
+ define boolean ModifyHandler (map options) {
+
+ if (!AutoOnlineUpdate::enabled)
+ return false;
+
+ if ((options["skip"]:"" == "yes" && !AutoOnlineUpdate::skipPre) ||
+ (options["skip"]:"" == "no" && AutoOnlineUpdate::skipPre))
+ {
+ AutoOnlineUpdate::skipPre = options["skip"]:"" == "yes";
+ AutoOnlineUpdate::modified = true;
+ }
+ if (haskey (options, "daily") && AutoOnlineUpdate::timing != `daily)
+ {
+ AutoOnlineUpdate::timing = `daily;
+ AutoOnlineUpdate::modified = true;
+ }
+ if (haskey (options, "weekly") && AutoOnlineUpdate::timing != `weekly)
+ {
+ AutoOnlineUpdate::timing = `weekly;
+ AutoOnlineUpdate::modified = true;
+ if (AutoOnlineUpdate::day < 0)
+ AutoOnlineUpdate::day = 0;
+ }
+ if (haskey (options, "day"))
+ {
+ integer day = options["day"]:0;
+ if (day < 0 || day > 7)
+ {
+ // command line error message
+ CommandLine::Print (_("The value of 'day' must be between 0 and 7."));
+ return false;
+ }
+ if (AutoOnlineUpdate::timing != `daily && day != AutoOnlineUpdate::day)
+ {
+ AutoOnlineUpdate::day = day;
+ AutoOnlineUpdate::modified = true;
+ }
+ }
+ if (haskey (options, "hour"))
+ {
+ integer hour = options["hour"]:0;
+ if (hour < 0 || hour > 23)
+ {
+ // command line error message
+ CommandLine::Print (_("The value of 'hour' must be between 0 and 23."));
+ return false;
+ }
+ if (hour != AutoOnlineUpdate::hour)
+ {
+ AutoOnlineUpdate::hour = hour;
+ AutoOnlineUpdate::modified = true;
+ }
+ }
+ if (haskey (options, "minute"))
+ {
+ integer minute = options["minute"]:0;
+ if (minute < 0 || minute > 59)
+ {
+ // command line error message
+ CommandLine::Print (_("The value of 'minute' must be between 0 and 59."));
+ return false;
+ }
+ if (minute != AutoOnlineUpdate::minute)
+ {
+ AutoOnlineUpdate::minute = minute;
+ AutoOnlineUpdate::modified = true;
+ }
+ }
+ return AutoOnlineUpdate::modified;
+ }
+
+ /**
+ * command line handler for enabling
+ */
+ define boolean EnableHandler (map options ) {
+ if (!AutoOnlineUpdate::enabled)
+ AutoOnlineUpdate::modified = true;
+ AutoOnlineUpdate::enabled = true;
+ ModifyHandler (options);
+ return AutoOnlineUpdate::modified;
+ }
+
+ /**
+ * command line handler for disabling
+ */
+ define boolean DisableHandler (map options ) {
+ if (AutoOnlineUpdate::enabled)
+ AutoOnlineUpdate::modified = true;
+ AutoOnlineUpdate::enabled = false;
+ return AutoOnlineUpdate::modified;
+ }
+
+ /**
+ * command line handler for summary
+ */
+ define boolean SummaryHandler (map options) {
+
+ CommandLine::Print (
+ // summary item
+ AutoOnlineUpdate::enabled ? _("Automatic Online Update is enabled.") :
+ // summary item
+ _("Automatic Online Update is disabled."));
+ if (!AutoOnlineUpdate::enabled)
+ return false;
+ if (AutoOnlineUpdate::skipPre)
+ // summary item
+ CommandLine::Print (_("Interactive patches will be skipped."));
+
+ integer hour = AutoOnlineUpdate::hour;
+ integer minute = AutoOnlineUpdate::minute;
+ string hour_str = (hour>9) ? sformat("%1", hour) : sformat("0%1", hour);
+ string minute_str = (minute>9) ? sformat("%1", minute) : sformat("0%1", minute);
+ // time string (when the update is run) %1 is hour, %2 minute
+ string time_str = sformat (_("at %1.%2"), hour_str, minute_str);
+ if (AutoOnlineUpdate::random_time)
+ // alternative time string (when the update is run)
+ time_str = _("at a random time");
+ if (AutoOnlineUpdate::timing == `weekly)
+ {
+ // summary item, %1 is day in the week, %2 is time string
+ CommandLine::Print (sformat (_("Update is scheduled on %1, %2."),
+ AutoOnlineUpdate::days[AutoOnlineUpdate::day]:"", time_str));
+ }
+ else
+ // summary item, %1 is time
+ CommandLine::Print (sformat (_("Update is scheduled daily %1."), time_str));
+ return false;
+ }
+
+ /**
+ * command line handler for writing
+ */
+ boolean WriteHandler () {
+
+ if (AutoOnlineUpdate::InstallUpdater ())
+ return AutoOnlineUpdate::Write ();
+ return false;
+ }
+
+ // the command line description map
+ map cmdline = $[
+ "id" : "online_update_setup",
+ // translators: command line help text
+ "help" : _("Setup Automatic Online Update"),
+ "initialize" : AutoOnlineUpdate::Read,
+ "finish" : WriteHandler,
+ "guihandler" : OnlineUpdateDialogs::SetupAutomatic,
+ "actions" : $[
+ "enable" :$[
+ "handler" : EnableHandler,
+ // translators: command line help text for enable action
+ "help" : _("Enable automatic online update")
+ ],
+ "disable" :$[
+ "handler" : DisableHandler,
+ // translators: command line help text for disable action
+ "help" : _("Disable automatic online update")
+ ],
+ "summary" : $[
+ "handler" : SummaryHandler,
+ // translators: command line help text summary action
+ "help" : _("Configuration summary"),
+ ],
+ "modify" : $[
+ "handler" : ModifyHandler,
+ // translators: command line help text for modify action
+ "help" : _("Modify current configuration"),
+ ],
+ ],
+ "options" : $[
+ "skip" : $[
+ // help for command line 'skip' option
+ "help" : _("Skip interactive patches"),
+ "type" : "enum",
+ "typespec" : [ "yes", "no" ],
+ ],
+ "daily" : $[
+ // help for command line 'daily' option
+ "help" : _("Set update to be done daily"),
+ ],
+ "weekly" : $[
+ // help for command line 'weekly' option
+ "help" : _("Set update to be done weekly"),
+ ],
+ "day" : $[
+ // help for command line 'day' option
+ "help" : _("Day in a week to do the weekly update (0-7)"),
+ "type" : "integer",
+ ],
+ "hour" : $[
+ // help for command line 'hour' option
+ "help" : _("Hour to do the update (0-23)"),
+ "type" : "integer",
+ ],
+ "minute" : $[
+ // help for command line 'minute' option
+ "help" : _("Minute to do the update (0-59)"),
+ "type" : "integer",
+ ],
+ ],
+ "mappings" : $[
+ "enable" : [ "skip", "daily", "weekly", "day", "hour", "minute" ],
+ "modify" : [ "skip", "daily", "weekly", "day", "hour", "minute" ],
+ "disable" : [],
+ ]
+ ];
- OnlineUpdateDialogs::SetupAutomatic();
+ return CommandLine::Run (cmdline);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-online-update-2.15.11/VERSION new/yast2-online-update-2.15.12/VERSION
--- old/yast2-online-update-2.15.11/VERSION 2007-04-26 15:29:33.000000000 +0200
+++ new/yast2-online-update-2.15.12/VERSION 2007-05-04 10:49:54.000000000 +0200
@@ -1 +1 @@
-2.15.11
+2.15.12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org