From 5b99cfa64a7c2fe10685c2796e83d2835d1f8e89 Mon Sep 17 00:00:00 2001 From: mschilli Date: Sun, 21 Feb 2010 00:01:14 -0800 Subject: [PATCH] [RT 54544] Tom Regner added support for updatev(). --- Changes | 3 ++- lib/RRDTool/OO.pm | 30 +++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 4e603f5..1a97d05 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ -0.29 (not yet released) +0.29 (02/20/2010) (ms) Added github repository link to Makefile.PL (ms) Fixed documentation for fetch_next(). + (ms) [RT 54544] Tom Regner added support for updatev(). 0.28 (11/05/2009) (ms) Applied patch by Lyle Brooks, adding optional step, start, and diff --git a/lib/RRDTool/OO.pm b/lib/RRDTool/OO.pm index 6c41c93..01c8448 100644 --- a/lib/RRDTool/OO.pm +++ b/lib/RRDTool/OO.pm @@ -7,7 +7,7 @@ use Carp; use RRDs; use Log::Log4perl qw(:easy); -our $VERSION = '0.28'; +our $VERSION = '0.29'; # Define the mandatory and optional parameters for every method. our $OPTIONS = { @@ -142,6 +142,7 @@ my %RRDs_functions = ( create => \&RRDs::create, fetch => \&RRDs::fetch, update => \&RRDs::update, + updatev => \&RRDs::updatev, graph => \&RRDs::graph, graphv => \&RRDs::graphv, info => \&RRDs::info, @@ -480,8 +481,25 @@ sub update { $update_string .= $options_hash{value}; } - $self->RRDs_execute("update", $self->{file}, - @update_options, $update_string); + my $caller = (caller(1))[3] ? (caller(1))[3] : ''; + my $updatecmd = $caller eq __PACKAGE__."::updatev" ? 'updatev' : 'update'; + my ($print_results) = + $self->RRDs_execute($updatecmd, $self->{file}, + @update_options, $update_string); + + if(!defined $print_results) { + return undef; + } + + $self->print_results( $print_results ); + + return 1; +} + +################################################# +sub updatev { +################################################# + &update (@_); } ################################################# @@ -1341,6 +1359,12 @@ names to values: C will transform this automagically into C I