[yast-commit] r60430 - in /trunk/yast2: VERSION library/runlevel/src/YaPI/SERVICES.pm package/yast2.changes
![](https://seccdn.libravatar.org/avatar/ccabc6c04379b11d036b089b67199614.jpg?s=120&d=mm&r=g)
Author: jsuchome Date: Mon Jan 18 14:47:40 2010 New Revision: 60430 URL: http://svn.opensuse.org/viewcvs/yast?rev=60430&view=rev Log: - SERVICES.pm: read descriptions (bnc#570298); get single service status from the Read function (bnc#570968) - 2.19.5 Modified: trunk/yast2/VERSION trunk/yast2/library/runlevel/src/YaPI/SERVICES.pm trunk/yast2/package/yast2.changes Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=60430&r1=60429&r2=60430&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Mon Jan 18 14:47:40 2010 @@ -1 +1 @@ -2.19.4 +2.19.5 Modified: trunk/yast2/library/runlevel/src/YaPI/SERVICES.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/runlevel/src/YaPI/SERVICES.pm?rev=60430&r1=60429&r2=60430&view=diff ============================================================================== --- trunk/yast2/library/runlevel/src/YaPI/SERVICES.pm (original) +++ trunk/yast2/library/runlevel/src/YaPI/SERVICES.pm Mon Jan 18 14:47:40 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: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=60430&r1=60429&r2=60430&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Mon Jan 18 14:47:40 2010 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jan 18 14:36:37 CET 2010 - jsuchome@suse.cz + +- SERVICES.pm: read descriptions (bnc#570298); get single service + status from the Read function (bnc#570968) +- 2.19.5 + +------------------------------------------------------------------- Fri Jan 15 11:44:39 CET 2010 - aschnell@suse.de - extended Report and Popup module (needed for fate #304500) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn.opensuse.org