Author: jsuchome Date: Mon Jan 18 14:47:23 2010 New Revision: 60428 URL: http://svn.opensuse.org/viewcvs/yast?rev=60428&view=rev Log: - SERVICES.pm: read descriptions (bnc#570298); get single service status from the Read function (bnc#570968) - 2.17.83 Modified: branches/SuSE-Code-11-SP1-Branch/yast2/VERSION branches/SuSE-Code-11-SP1-Branch/yast2/library/runlevel/src/YaPI/SERVICES.pm branches/SuSE-Code-11-SP1-Branch/yast2/package/yast2.changes Modified: branches/SuSE-Code-11-SP1-Branch/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/yast2/VERSION?rev=60428&r1=60427&r2=60428&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/yast2/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/yast2/VERSION Mon Jan 18 14:47:23 2010 @@ -1 +1 @@ -2.17.82 +2.17.83 Modified: branches/SuSE-Code-11-SP1-Branch/yast2/library/runlevel/src/YaPI/SERVICES.pm URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/yast2/library/runlevel/src/YaPI/SERVICES.pm?rev=60428&r1=60427&r2=60428&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/yast2/library/runlevel/src/YaPI/SERVICES.pm (original) +++ branches/SuSE-Code-11-SP1-Branch/yast2/library/runlevel/src/YaPI/SERVICES.pm Mon Jan 18 14:47:23 2010 @@ -116,9 +116,11 @@ # Return the map of services enabled in given runlevel # Parameter is an argument map with possible keys: # "runlevel" : integer -# "read_status" : if present, service status will be queried -# "custom" : if present, custom services (defined in config file) will be read -# returns array of hashes +# "read_status" : if true, service status will be queried +# "custom" : if true, custom services (defined in config file) will be read +# "description" : if true, read the description of each service +# "service" : if defined, the status of this given service will be returned +# @returns array of hashes BEGIN{$TYPEINFO{Read} = ["function", ["list", [ "map", "string", "any"]], ["map", "string", "any"]]; @@ -131,6 +133,21 @@ my $runlevel = 5; $runlevel = $args->{"runlevel"} if defined $args->{"runlevel"}; + # only read status of one service if the name was given + if ($args->{"service"} || "") { + my $exec = $self->Execute ({ + "name" => $args->{"service"} || "", + "action" => "status", + "custom" => $args->{"custom"} || 0 + }); + my $s = { + "name" => $args->{"service"} || "", + "status" => $exec->{"exit"} || 0 + }; + push @ret, $s; + return \@ret; + } + if ($args->{"custom"} || 0) { return read_custom_services ($args); } @@ -140,6 +157,11 @@ "name" => $name }; $s->{"status"} = Service->Status ($name) if ($args->{"read_status"} || 0); + if (($args->{"description"} || 0) || ($args->{"shortdescription"} || 0)) { + my $info = Service->Info ($name); + $s->{"description"} = ($info->{"description"} || "") if $args->{"description"} || 0; + $s->{"shortdescription"}= ($info->{"shortdescription"} || "") if $args->{"shortdescription"} || 0; + } push @ret, $s; } return \@ret; Modified: branches/SuSE-Code-11-SP1-Branch/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/yast2/package/yast2.changes?rev=60428&r1=60427&r2=60428&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/yast2/package/yast2.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/yast2/package/yast2.changes Mon Jan 18 14:47:23 2010 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jan 18 14:38:15 CET 2010 - jsuchome@suse.cz + +- SERVICES.pm: read descriptions (bnc#570298); get single service + status from the Read function (bnc#570968) +- 2.17.83 + +------------------------------------------------------------------- Thu Jan 14 17:21:30 CET 2010 - mzugec@suse.cz - NetworkStorage: adapt functions needed for iBFT (bnc#551380) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org