]> git.pld-linux.org Git - packages/cacti.git/blame - cacti-rrdtool-1.3.patch
- /usr/share/cacti/rra -> /var/lib/cacti/rra for broken installations.
[packages/cacti.git] / cacti-rrdtool-1.3.patch
CommitLineData
bad51e41
AM
1Index: graph.php
2===================================================================
3--- graph.php (wersja 4583)
4+++ graph.php (wersja 4584)
5@@ -174,7 +174,7 @@
6
7 $graph_height = $graph["height"];
8 $graph_width = $graph["width"];
9- if ((read_config_option("rrdtool_version")) == "rrd-1.2.x") {
10+ if ((read_config_option("rrdtool_version")) != "rrd-1.0.x") {
11 if (read_graph_config_option("title_font") == "") {
12 if (read_config_option("title_font") == "") {
13 $title_font_size = 10;
14Index: lib/rrd.php
15===================================================================
16--- lib/rrd.php (wersja 4583)
17+++ lib/rrd.php (wersja 4584)
18@@ -610,7 +610,7 @@
19 }
20 break;
21 case "3": /* autoscale-min, accepts a given upper limit */
22- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
23+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
24 $scale = "--alt-autoscale-min" . RRD_NL;
25 if ( is_numeric($graph["upper_limit"])) {
26 $scale .= "--upper-limit=" . $graph["upper_limit"] . RRD_NL;
27@@ -647,7 +647,7 @@
28 }
29
30 if (!empty($graph["unit_value"])) {
31- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
32+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
33 $unit_value = "--y-grid=" . $graph["unit_value"] . RRD_NL;
34 }else{
35 $unit_value = "--unit=" . $graph["unit_value"] . RRD_NL;
36@@ -743,13 +743,13 @@
37 /* display the timespan for zoomed graphs */
38 if ((isset($graph_data_array["graph_start"])) && (isset($graph_data_array["graph_end"]))) {
39 if (($graph_data_array["graph_start"] < 0) && ($graph_data_array["graph_end"] < 0)) {
40- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
41+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
42 $graph_legend .= "COMMENT:\"From " . str_replace(":", "\:", date($graph_date, time()+$graph_data_array["graph_start"])) . " To " . str_replace(":", "\:", date($graph_date, time()+$graph_data_array["graph_end"])) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
43 }else {
44 $graph_legend .= "COMMENT:\"From " . date($graph_date, time()+$graph_data_array["graph_start"]) . " To " . date($graph_date, time()+$graph_data_array["graph_end"]) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
45 }
46 }else if (($graph_data_array["graph_start"] >= 0) && ($graph_data_array["graph_end"] >= 0)) {
47- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
48+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
49 $graph_legend .= "COMMENT:\"From " . str_replace(":", "\:", date($graph_date, $graph_data_array["graph_start"])) . " To " . str_replace(":", "\:", date($graph_date, $graph_data_array["graph_end"])) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
50 }else {
51 $graph_legend .= "COMMENT:\"From " . date($graph_date, $graph_data_array["graph_start"]) . " To " . date($graph_date, $graph_data_array["graph_end"]) . "\\c\"" . RRD_NL . "COMMENT:\" \\n\"" . RRD_NL;
52@@ -774,14 +774,14 @@
53 "--vertical-label=\"" . $graph["vertical_label"] . "\"" . RRD_NL;
54
55 /* rrdtool 1.2.x does not provide smooth lines, let's force it */
56- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
57+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
58 if ($graph["slope_mode"] == "on") {
59 $graph_opts .= "--slope-mode" . RRD_NL;
60 }
61 }
62
63 /* rrdtool 1.2 font options */
64- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
65+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
66 /* title fonts */
67 $graph_opts .= rrdtool_set_font("title", ((!empty($graph_data_array["graph_nolegend"])) ? $graph_data_array["graph_nolegend"] : ""));
68
69@@ -1129,7 +1129,7 @@
70 $need_rrd_nl = TRUE;
71
72 if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") {
73- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
74+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
75 $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]) . $hardreturn[$graph_item_id] . "\" ";
76 if (trim($comment_string) != "COMMENT:\"\"") {
77 $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
78@@ -1150,7 +1150,7 @@
79 $graph_item_color_code = "";
80 }else{
81 $graph_item_color_code = "#" . $graph_item["hex"];
82- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
83+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
84 $graph_item_color_code .= $graph_item["alpha"];
85 }
86 }
87@@ -1160,7 +1160,7 @@
88 $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
89 $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . $data_source_name . $graph_item_color_code . ":" . "\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\" ";
90 }elseif ($graph_item_types{$graph_item["graph_type_id"]} == "STACK") {
91- if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
92+ if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
93 $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
94 $txt_graph_items .= $graph_item_stack_type . ":" . $data_source_name . $graph_item_color_code . ":" . "\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\":STACK";
95 }else {
96Index: utilities.php
97===================================================================
98--- utilities.php (wersja 4583)
99+++ utilities.php (wersja 4584)
100@@ -225,7 +225,9 @@
101 exec(read_config_option("path_rrdtool"), $out_array);
102
103 if (sizeof($out_array) > 0) {
104- if (ereg("^RRDtool 1\.2", $out_array[0])) {
105+ if (ereg("^RRDtool 1\.3", $out_array[0])) {
106+ $rrdtool_version = "rrd-1.3.x";
107+ }else if (ereg("^RRDtool 1\.2\.", $out_array[0])) {
108 $rrdtool_version = "rrd-1.2.x";
109 }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) {
110 $rrdtool_version = "rrd-1.0.x";
111@@ -239,7 +241,7 @@
112 $rrdtool_error .= "<br><font color='red'>ERROR: Installed RRDTool version does not match configured version.<br>Please visit the <a href='settings.php?tab=general'>Configuration Settings</a> and select the correct RRDTool Utility Version.</font><br>";
113 }
114 $graph_gif_count = db_fetch_cell("SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2");
115- if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") == "rrd-1.2.x")) {
116+ if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") != "rrd-1.0.x")) {
117 $rrdtool_error .= "<br><font color='red'>ERROR: RRDTool 1.2.x does not support the GIF images format, but " . $graph_gif_count . " graph(s) and/or templates have GIF set as the image format.</font><br>";
118 }
119
120Index: install/index.php
121===================================================================
122--- install/index.php (wersja 4583)
123+++ install/index.php (wersja 4584)
124@@ -262,7 +262,9 @@
125 exec($input["path_rrdtool"]["default"], $out_array);
126
127 if (sizeof($out_array) > 0) {
128- if (ereg("^RRDtool 1\.2", $out_array[0])) {
129+ if (ereg("^RRDtool 1\.3", $out_array[0])) {
130+ $input["rrdtool_version"]["default"] = "rrd-1.3.x";
131+ }else if (ereg("^RRDtool 1\.2\.", $out_array[0])) {
132 $input["rrdtool_version"]["default"] = "rrd-1.2.x";
133 }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) {
134 $input["rrdtool_version"]["default"] = "rrd-1.0.x";
922adc73
AM
135Index: include/global_arrays.php
136===================================================================
137--- include/global_arrays.php (wersja 4581)
138+++ include/global_arrays.php (wersja 4582)
139@@ -257,7 +256,8 @@
140
141 $rrdtool_versions = array(
142 "rrd-1.0.x" => "RRDTool 1.0.x",
143- "rrd-1.2.x" => "RRDTool 1.2.x");
144+ "rrd-1.2.x" => "RRDTool 1.2.x",
145+ "rrd-1.3.x" => "RRDTool 1.3.x");
146
147 $cdef_item_types = array(
148 1 => "Function",
149
This page took 0.130502 seconds and 4 git commands to generate.