[Orca-checkins] r467 - trunk/orca/lib/Orca

blair at orcaware.com blair at orcaware.com
Wed Jul 20 19:49:33 PDT 2005


Author: blair at orcaware.com
Date: Wed Jul 20 19:48:44 2005
New Revision: 467

Modified:
   trunk/orca/lib/Orca/ImageFile.pm

Log:
Fix an incompatible change in RRDtool 1.2 where colons in COMMENT
arguments to RRDs::graph must be escaped with a backslash.

Patch by: Alex Kiernan <alex.kiernan at gmail.com>

* lib/Orca/ImageFile.pm
  (_plot):
    If RRDs 1.2 or greater is used, then escape all colons with a
    backslash.


Modified: trunk/orca/lib/Orca/ImageFile.pm
==============================================================================
--- trunk/orca/lib/Orca/ImageFile.pm	(original)
+++ trunk/orca/lib/Orca/ImageFile.pm	Wed Jul 20 19:48:44 2005
@@ -400,6 +400,14 @@
 
   my $plot_ref = $self->[I_PLOT_REF];
 
+  # An incompatible change was introduced in RRDtool 1.2 where colons
+  # in COMMENT arguments to RRDs::graph must be escaped with a
+  # backslash.
+  my $plot_end_time_ctime = localtime($plot_end_time);
+  if ($RRDs::VERSION >= 1.2) {
+    $plot_end_time_ctime =~ s/:/\\:/g;
+  }
+
   my ($graph_return, $image_width, $image_height) =
     RRDs::graph
       $image_filename,
@@ -410,7 +418,7 @@
       '-w', $plot_ref->{plot_width},
       '-h', $plot_ref->{plot_height},
       'COMMENT:\s',
-      'COMMENT:Last data entered at ' . localtime($plot_end_time) . '.';
+      "COMMENT:Last data entered at $plot_end_time_ctime.";
   if (my $error = RRDs::error) {
     warn "$0: warning: cannot create '$image_filename': $error\n";
     return;



More information about the Orca-checkins mailing list