Author: jsuchome Date: Wed Jul 2 08:43:47 2008 New Revision: 48743 URL: http://svn.opensuse.org/viewcvs/yast?rev=48743&view=rev Log: timezone agent Added: branches/tmp/lslezak/workshop/country/timezone/agents/ag_timezone (with props) branches/tmp/lslezak/workshop/country/timezone/agents/timezone.scr Added: branches/tmp/lslezak/workshop/country/timezone/agents/ag_timezone URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/country/timezone/agents/ag_timezone?rev=48743&view=auto ============================================================================== --- branches/tmp/lslezak/workshop/country/timezone/agents/ag_timezone (added) +++ branches/tmp/lslezak/workshop/country/timezone/agents/ag_timezone Wed Jul 2 08:43:47 2008 @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +use lib "/usr/lib/YaST2/agents_non_y2"; +use ycp; +use strict; + + +# --------------------------------------- main ----------------------------- +while ( <STDIN> ) +{ + + my ($command, $path, $argument) = ycp::ParseCommand ($_); + + y2debug ("command: $command, path: $path"); + + if ($command eq "Read") { + + if (0) { + } + else { + y2error ("wrong path ($path) or argument: ", ref ($argument)); + ycp::Return("false"); + } + } + elsif ( $command eq "Write" ) + { + if ($path eq '.') { + if (!defined $argument || !$argument) { + y2error ("argument is missing or empty"); + ycp::Return("false"); + } + else { + my $cmd = "/usr/sbin/zic -l $argument"; + y2debug ("command to call: '$cmd'"); + my $out = `LANG=C $cmd 2>&1`; + if ($out) { + y2error ("cmd ($cmd) returned: $out"); + ycp::Return("false"); + } + else { + ycp::Return("true"); + } + } + } + else { + y2error ("wrong path ($path) or argument type: ", ref ($argument)); + ycp::Return("false"); + } + } + elsif ( $command eq "result") + { + exit; + } + else + { + y2error ("wrong command: $command"); + ycp::Return("wrong command ($command)"); + } +} + +# end Added: branches/tmp/lslezak/workshop/country/timezone/agents/timezone.scr URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/country/timezone/agents/timezone.scr?rev=48743&view=auto ============================================================================== --- branches/tmp/lslezak/workshop/country/timezone/agents/timezone.scr (added) +++ branches/tmp/lslezak/workshop/country/timezone/agents/timezone.scr Wed Jul 2 08:43:47 2008 @@ -0,0 +1,6 @@ +/** + * File: + */ +.timezone + +`ag_timezone () -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org