Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (38106cbc6350ead8b1c5a3152fcb6dd2c6c33a94)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (38106cbc6350ead8b1c5a3152fcb6dd2c6c33a94)
  • Date: Fri, 21 May 2010 10:58:07 -0500

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

net/cacti/DETAILS | 11
net/cacti/FINAL | 1
net/cacti/HISTORY | 5
net/cacti/INSTALL | 6
net/cacti/PRE_BUILD | 8
net/cacti/patches/cli_add_graph.patch | 11
net/cacti/patches/cross_site_fix.patch | 175 -------------
net/cacti/patches/snmp_invalid_response.patch | 25 -
net/cacti/patches/sql_injection_template_export.patch | 13 -
net/cacti/patches/template_duplication.patch | 234
------------------
net/spine/HISTORY | 4
net/spine/INSTALL | 3
net/spine/PRE_BUILD | 14 -
net/spine/config.patch | 11
14 files changed, 45 insertions(+), 476 deletions(-)

New commits:
commit 38106cbc6350ead8b1c5a3152fcb6dd2c6c33a94
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

spine: don't trash config file

commit 931ead7a86b67e7c20a589c90569cf9e58ce0616
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

cacti: => 0.8.7f

diff --git a/net/cacti/DETAILS b/net/cacti/DETAILS
index 5bbb0ae..0ae9773 100755
--- a/net/cacti/DETAILS
+++ b/net/cacti/DETAILS
@@ -1,18 +1,17 @@
SPELL=cacti
- VERSION=0.8.7e
+ VERSION=0.8.7f
SECURITY_PATCH=1
- PATCHLEVEL=2
SOURCE=$SPELL-$VERSION.tar.gz
if [[ $CACTI_PA == y ]]; then
- VERSION_PA=2.6
- SOURCE2=$SPELL-plugin-$VERSION-PA-v${VERSION_PA}.zip
+ VERSION_PA=2.7
+ SOURCE2=$SPELL-plugin-$VERSION-PA-v${VERSION_PA}.tar.gz
SOURCE2_URL[0]=http://mirror.cactiusers.org/downloads/plugins/$SOURCE2
-
SOURCE2_HASH=sha512:0468d1d688f957b01e331dd554626fd2efb601fd6e78b170234925578c2da0d81e8c914854b99991b2a807315f20bdc2f49ff18965a5ed737d369ac2db107744
+
SOURCE2_HASH=sha512:a7d7f00fd0a1bb38b40234d48d94681945854c512f012cb3b032356e92e568be409fc1eab5eac7b8db870c264a4b8dbf18676bbba5bca006bd735854e09dae6d
SOURCE_DIRECTORY2="$BUILD_DIRECTORY/$SPELL-PA-${VERSION_PA}"
fi
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
SOURCE_URL[0]=http://www.cacti.net/downloads/$SOURCE
-
SOURCE_HASH=sha512:b826381cc5e76f95a9bea32754785121d09da505f139323b7d111321f353d7be9ab8cedc5ae26cea828b23a36ad2fca7c2bcd82f541fc3bf485b209698924fdb
+
SOURCE_HASH=sha512:79d3915ff12d5a16b5fe7709b169e426ddd45a7ebd7bdbb7ed999e7dbfe2907b54b9c6e20a587726c8ef21ec1bd5a97381988d07cb29bf750f24e272e69fdab5
LICENSE[0]=GPL
WEB_SITE=http://www.cacti.net/
ENTERED=20060131
diff --git a/net/cacti/FINAL b/net/cacti/FINAL
deleted file mode 100755
index 4591c68..0000000
--- a/net/cacti/FINAL
+++ /dev/null
@@ -1 +0,0 @@
-rm_source_dir "$SOURCE_DIRECTORY2"
diff --git a/net/cacti/HISTORY b/net/cacti/HISTORY
index 5ee2f3a..8f75db2 100644
--- a/net/cacti/HISTORY
+++ b/net/cacti/HISTORY
@@ -1,3 +1,8 @@
+2010-05-21 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: updated spell to 0.8.7f; Plugin Arch -- to 2.7
+ * PRE_BUILD: apply patches only if they exist
+ * FINAL: removed, instructions moved to INSTALL
+
2010-04-23 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: SECURITY_PATCH=1
* patches/sql_injection_template_export.patch: added
diff --git a/net/cacti/INSTALL b/net/cacti/INSTALL
index 16ae094..cd7fd58 100755
--- a/net/cacti/INSTALL
+++ b/net/cacti/INSTALL
@@ -1,2 +1,6 @@
cd ${SOURCE_DIRECTORY} &&
-install_www_files
+install_www_files &&
+
+if [[ $CACTI_PA == y ]]; then
+ rm_source_dir "$SOURCE_DIRECTORY2"
+fi
diff --git a/net/cacti/PRE_BUILD b/net/cacti/PRE_BUILD
index 12f877c..12e9f98 100755
--- a/net/cacti/PRE_BUILD
+++ b/net/cacti/PRE_BUILD
@@ -8,9 +8,11 @@ fi &&

cd "$SOURCE_DIRECTORY" &&

-for patch in "$SPELL_DIRECTORY/patches"/*.patch; do
- patch -p1 < $patch
-done &&
+if [[ -d "$SPELL_DIRECTORY/patches" ]]; then
+ for patch in "$SPELL_DIRECTORY/patches"/*.patch; do
+ patch -p1 < $patch
+ done
+fi &&

if [[ $CACTI_PA == y ]]; then
cat "$SOURCE_DIRECTORY2/cacti-plugin-arch/pa.sql" >> cacti.sql &&
diff --git a/net/cacti/patches/cli_add_graph.patch
b/net/cacti/patches/cli_add_graph.patch
deleted file mode 100644
index b82d21a..0000000
--- a/net/cacti/patches/cli_add_graph.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ../tags/0.8.7e/cli/add_graphs.php 2009-06-28 12:34:31.000000000 -0400
-+++ 0.8.7/cli/add_graphs.php 2009-08-18 20:04:44.000000000 -0400
-@@ -570,7 +570,7 @@
- echo " 3|Fields = Verify all Fields\n";
- echo "List Options:\n";
- echo " --list-hosts\n";
-- echo " --list-graph-templates [--host_template=[ID]]\n";
-+ echo " --list-graph-templates [--host-template-id=[ID]]\n";
- echo " --list-input-fields --graph-template-id=[ID]\n";
- echo " --list-snmp-queries\n";
- echo " --list-query-types --snmp-query-id [ID]\n";
diff --git a/net/cacti/patches/cross_site_fix.patch
b/net/cacti/patches/cross_site_fix.patch
deleted file mode 100644
index ddc9e2e..0000000
--- a/net/cacti/patches/cross_site_fix.patch
+++ /dev/null
@@ -1,175 +0,0 @@
---- cacti-0.8.7e/graph.php 2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/graph.php 2009-11-21 23:10:16.000000000 -0500
-@@ -35,6 +35,8 @@
- /* ================= input validation ================= */
- input_validate_input_regex(get_request_var_request("rra_id"),
"^([0-9]+|all)$");
- input_validate_input_number(get_request_var("local_graph_id"));
-+input_validate_input_number(get_request_var("graph_end"));
-+input_validate_input_number(get_request_var("graph_start"));
- input_validate_input_regex(get_request_var_request("view_type"),
"^([a-zA-Z0-9]+)$");
- /* ==================================================== */
-
---- cacti-0.8.7e/include/top_graph_header.php 2009-06-28 12:07:11.000000000
-0400
-+++ cacti-0.8.7e-patched/include/top_graph_header.php 2009-11-21
23:15:27.000000000 -0500
-@@ -58,7 +58,7 @@
- if ($_SESSION["custom"]) {
- print "<meta http-equiv=refresh content='99999'>\r\n";
- }else{
-- print "<meta http-equiv=refresh content='" .
read_graph_config_option("page_refresh") . "'>\r\n";
-+ print "<meta http-equiv=refresh content='" .
htmlspecialchars(read_graph_config_option("page_refresh"),ENT_QUOTES) .
"'>\r\n";
- }
- }
- ?>
-@@ -113,7 +113,7 @@
- </tr>
- <tr class="noprint">
- <td bgcolor="#efefef" colspan="1" height="8"
style="background-image: url(images/shadow_gray.gif); background-repeat:
repeat-x; border-right: #aaaaaa 1px solid;">
-- <img src="images/transparent_line.gif" width="<?php
print read_graph_config_option("default_dual_pane_width");?>" height="2"
border="0"><br>
-+ <img src="images/transparent_line.gif" width="<?php
print
htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>"
height="2" border="0"><br>
- </td>
- <td bgcolor="#ffffff" colspan="1" height="8"
style="background-image: url(images/shadow.gif); background-repeat:
repeat-x;">
-
-@@ -144,7 +144,7 @@
-
- <tr>
- <?php if ((read_graph_config_option("default_tree_view_mode")
== "2") && (($_REQUEST["action"] == "tree") ||
((isset($_REQUEST["view_type"]) ? $_REQUEST["view_type"] : "") == "tree"))) {
?>
-- <td valign="top" style="padding: 5px; border-right: #aaaaaa
1px solid;" bgcolor='#efefef' width='<?php print
read_graph_config_option("default_dual_pane_width");?>' class='noprint'>
-+ <td valign="top" style="padding: 5px; border-right: #aaaaaa
1px solid;" bgcolor='#efefef' width='<?php print
htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>'
class='noprint'>
- <table border=0 cellpadding=0
cellspacing=0><tr><td><font size=-2><a
style="font-size:7pt;text-decoration:none;color:silver"
href="http://www.treemenu.net/"; target=_blank></a></font></td></tr></table>
- <?php grow_dhtml_trees(); ?>
- <script
type="text/javascript">initializeDocument();</script>
---- cacti-0.8.7e/lib/html_form.php 2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/lib/html_form.php 2009-11-21 23:15:40.000000000
-0500
-@@ -235,13 +235,21 @@
-
- if (sizeof($items) > 0) {
- foreach ($items as $item) {
-- print $item["name"] . "<br>";
-+ print htmlspecialchars($item["name"],ENT_QUOTES) .
"<br>";
- }
- }
-
- break;
-+ case 'font':
-+ form_font_box($field_name, $field_array["value"],
-+ ((isset($field_array["default"])) ?
$field_array["default"] : ""),
-+ $field_array["max_length"],
-+ ((isset($field_array["size"])) ? $field_array["size"]
: "40"), "text",
-+ ((isset($field_array["form_id"])) ?
$field_array["form_id"] : ""));
-+
-+ break;
- default:
-- print "<em>" . $field_array["value"] . "</em>";
-+ print "<em>" .
htmlspecialchars($field_array["value"],ENT_QUOTES) . "</em>";
-
- form_hidden_box($field_name, $field_array["value"], "");
-
-@@ -384,7 +392,7 @@
- $form_previous_value = $form_default_value;
- }
-
-- print "<input type='hidden' id='$form_name' name='$form_name'
value='$form_previous_value'>\n";
-+ print "<input type='hidden' id='$form_name' name='$form_name'
value='" . htmlspecialchars($form_previous_value, ENT_QUOTES) . "'>\n";
- }
-
- /* form_dropdown - draws a standard html dropdown box
-@@ -568,7 +576,7 @@
- }
- }
-
-- print ">". $array_display[$id];
-+ print ">". htmlspecialchars($array_display[$id],ENT_QUOTES);
- print "</option>\n";
- }
-
-@@ -627,6 +635,65 @@
- print "</select>\n";
- }
-
-+/* form_font_box - draws a standard html textbox and provides status of a
fonts existence
-+ @arg $form_name - the name of this form element
-+ @arg $form_previous_value - the current value of this form element
-+ @arg $form_default_value - the value of this form element to use if
there is
-+ no current value available
-+ @arg $form_max_length - the maximum number of characters that can be
entered
-+ into this textbox
-+ @arg $form_size - the size (width) of the textbox
-+ @arg $type - the type of textbox, either 'text' or 'password'
-+ @arg $current_id - used to determine if a current value for this form
element
-+ exists or not. a $current_id of '0' indicates that no current value
exists,
-+ a non-zero value indicates that a current value does exist */
-+function form_font_box($form_name, $form_previous_value,
$form_default_value, $form_max_length, $form_size = 30, $type = "text",
$current_id = 0) {
-+ if (($form_previous_value == "") && (empty($current_id))) {
-+ $form_previous_value = $form_default_value;
-+ }
-+
-+ print "<input type='$type'";
-+
-+ if (isset($_SESSION["sess_error_fields"])) {
-+ if (!empty($_SESSION["sess_error_fields"][$form_name])) {
-+ print "class='txtErrorTextBox'";
-+ unset($_SESSION["sess_error_fields"][$form_name]);
-+ }
-+ }
-+
-+ if (isset($_SESSION["sess_field_values"])) {
-+ if (!empty($_SESSION["sess_field_values"][$form_name])) {
-+ $form_previous_value =
$_SESSION["sess_field_values"][$form_name];
-+ }
-+ }
-+
-+ if (strlen($form_previous_value) == 0) { # no data: defaults are
used; everythings fine
-+ $extra_data = "";
-+ } else {
-+ if (read_config_option("rrdtool_version") == "rrd-1.3.x") {
# rrdtool 1.3 uses fontconfig
-+ $font = '"' . $form_previous_value . '"';
-+ $out_array = array();
-+ exec('fc-list ' . $font, $out_array);
-+ if (sizeof($out_array) == 0) {
-+ $extra_data = "<span style='color:red'><br>["
. "ERROR: FONT NOT FOUND" . "]</span>";
-+ } else {
-+ $extra_data = "<span
style='color:green'><br>[" . "OK: FONT FOUND" . "]</span>";
-+ }
-+ } elseif (read_config_option("rrdtool_version") ==
"rrd-1.0.x" ||
-+ read_config_option("rrdtool_version") ==
"rrd-1.2.x") { # rrdtool 1.0 and 1.2 use font files
-+ if (is_file($form_previous_value)) {
-+ $extra_data = "<span
style='color:green'><br>[" . "OK: FILE FOUND" . "]</span>";
-+ }else if (is_dir($form_previous_value)) {
-+ $extra_data = "<span style='color:red'><br>["
. "ERROR: IS DIR" . "]</span>";
-+ }else{
-+ $extra_data = "<span style='color:red'><br>["
. "ERROR: FILE NOT FOUND" . "]</span>";
-+ }
-+ } # will be used for future versions of rrdtool
-+ }
-+
-+ print " id='$form_name' name='$form_name' size='$form_size'" .
(!empty($form_max_length) ? " maxlength='$form_max_length'" : "") . "
value='" . htmlspecialchars($form_previous_value, ENT_QUOTES) . "'>" .
$extra_data;
-+}
-+
- /* form_confirm - draws a table presenting the user with some choice and
allowing
- them to either proceed (delete) or cancel
- @arg $body_text - the text to prompt the user with on this form
---- cacti-0.8.7e/lib/timespan_settings.php 2009-06-28 12:07:11.000000000
-0400
-+++ cacti-0.8.7e-patched/lib/timespan_settings.php 2009-11-21
23:15:49.000000000 -0500
-@@ -125,9 +125,9 @@
- if (isset($_POST["date1"])) {
- /* the dates have changed, therefore, I am now custom */
- if (($_SESSION["sess_current_date1"] != $_POST["date1"]) ||
($_SESSION["sess_current_date2"] != $_POST["date2"])) {
-- $timespan["current_value_date1"] = $_POST["date1"];
-+ $timespan["current_value_date1"] =
sanitize_search_string($_POST["date1"]);
- $timespan["begin_now"]
=strtotime($timespan["current_value_date1"]);
-- $timespan["current_value_date2"] = $_POST["date2"];
-+ $timespan["current_value_date2"] =
sanitize_search_string($_POST["date2"]);
-
$timespan["end_now"]=strtotime($timespan["current_value_date2"]);
- $_SESSION["sess_current_timespan"] = GT_CUSTOM;
- $_SESSION["custom"] = 1;
-@@ -135,8 +135,8 @@
- }else {
- /* the default button wasn't pushed */
- if (!isset($_POST["button_clear_x"])) {
-- $timespan["current_value_date1"] =
$_POST["date1"];
-- $timespan["current_value_date2"] =
$_POST["date2"];
-+ $timespan["current_value_date1"] =
sanitize_search_string($_POST["date1"]);
-+ $timespan["current_value_date2"] =
sanitize_search_string($_POST["date2"]);
- $timespan["begin_now"] =
$_SESSION["sess_current_timespan_begin_now"];
- $timespan["end_now"] =
$_SESSION["sess_current_timespan_end_now"];
-
diff --git a/net/cacti/patches/snmp_invalid_response.patch
b/net/cacti/patches/snmp_invalid_response.patch
deleted file mode 100644
index 5b2dd20..0000000
--- a/net/cacti/patches/snmp_invalid_response.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- ../tags/0.8.7e/include/global_arrays.php 2009-06-28 12:34:31.000000000
-0400
-+++ 0.8.7/include/global_arrays.php 2009-08-18 20:04:44.000000000 -0400
-@@ -174,6 +174,10 @@
- "DES" => "DES (default)",
- "AES128" => "AES");
-
-+$banned_snmp_strings = array(
-+ "End of MIB",
-+ "No Such");
-+
- $logfile_options = array(1 =>
- "Logfile Only",
- "Logfile and Syslog/Eventlog",
---- ../tags/0.8.7e/lib/snmp.php 2009-06-28 12:34:30.000000000 -0400
-+++ 0.8.7/lib/snmp.php 2009-08-18 20:04:44.000000000 -0400
-@@ -27,9 +27,6 @@
- define("SNMP_METHOD_PHP", 1);
- define("SNMP_METHOD_BINARY", 2);
-
--/* declare once, use many times */
--$banned_snmp_strings = array("End of MIB", "No Such");
--
- /* we must use an apostrophe to escape community names under Unix in case
the user uses
- characters that the shell might interpret. the ucd-snmp binaries on Windows
flip out when
- you do this, but are perfectly happy with a quotation mark. */
diff --git a/net/cacti/patches/sql_injection_template_export.patch
b/net/cacti/patches/sql_injection_template_export.patch
deleted file mode 100644
index 397990c..0000000
--- a/net/cacti/patches/sql_injection_template_export.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- cacti-0.8.7e/templates_export.php 2009-06-28 12:07:11.000000000 -0400
-+++ cacti-fixed/templates_export.php 2010-04-17 14:08:42.000000000 -0400
-@@ -49,6 +49,10 @@
- function form_save() {
- global $export_types;
-
-+ /* ================= input validation ================= */
-+ input_validate_input_number(get_request_var_post("export_item_id"));
-+ /* ==================================================== */
-+
- if (isset($_POST["save_component_export"])) {
- $xml_data = get_item_xml($_POST["export_type"],
$_POST["export_item_id"], (((isset($_POST["include_deps"]) ?
$_POST["include_deps"] : "") == "") ? false : true));
-
diff --git a/net/cacti/patches/template_duplication.patch
b/net/cacti/patches/template_duplication.patch
deleted file mode 100644
index cd6ff4b..0000000
--- a/net/cacti/patches/template_duplication.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-diff -ruBbd 0.8.7e/cli/repair_templates.php 0.8.7/cli/repair_templates.php
---- 0.8.7e/cli/repair_templates.php 2009-08-18 22:03:22.000000000 -0400
-+++ 0.8.7/cli/repair_templates.php 2009-08-20 07:43:54.000000000 -0400
-@@ -0,0 +1,135 @@
-+<?php
-+/*
-+ +-------------------------------------------------------------------------+
-+ | Copyright (C) 2004-2009 The Cacti Group |
-+ | |
-+ | This program is free software; you can redistribute it and/or |
-+ | modify it under the terms of the GNU General Public License |
-+ | as published by the Free Software Foundation; either version 2 |
-+ | of the License, or (at your option) any later version. |
-+ | |
-+ | This program is distributed in the hope that it will be useful, |
-+ | but WITHOUT ANY WARRANTY; without even the implied warranty of |
-+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
-+ | GNU General Public License for more details. |
-+ +-------------------------------------------------------------------------+
-+ | Cacti: The Complete RRDTool-based Graphing Solution |
-+ +-------------------------------------------------------------------------+
-+ | This code is designed, written, and maintained by the Cacti Group. See |
-+ | about.php and/or the AUTHORS file for specific developer information. |
-+ +-------------------------------------------------------------------------+
-+ | http://www.cacti.net/ |
-+ +-------------------------------------------------------------------------+
-+*/
-+
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) ||
isset($_SERVER['REMOTE_ADDR'])) {
-+ die("<br><strong>This script is only meant to run at the command
line.</strong>");
-+}
-+
-+$no_http_headers = true;
-+
-+include(dirname(__FILE__) . "/../include/global.php");
-+include_once("../lib/utility.php");
-+include_once("../lib/template.php");
-+
-+/* process calling arguments */
-+$parms = $_SERVER["argv"];
-+array_shift($parms);
-+
-+$execute = FALSE;
-+
-+foreach($parms as $parameter) {
-+ @list($arg, $value) = @explode("=", $parameter);
-+
-+ switch ($arg) {
-+ case "--execute":
-+ $execute = TRUE;
-+ break;
-+ case "-h":
-+ case "-v":
-+ case "-V":
-+ case "--version":
-+ case "--help":
-+ display_help();
-+ exit;
-+ default:
-+ print "ERROR: Invalid Parameter " . $parameter . "\n\n";
-+ display_help();
-+ exit;
-+ }
-+}
-+
-+if ($execute) {
-+ echo "NOTE: Repairing All Duplicated Templates\n";
-+} else {
-+ echo "NOTE: Performing Check of Templates\n";
-+}
-+
-+/* repair data templates first */
-+if ($execute) {
-+ echo "NOTE: Repairing Data Templates\n";
-+} else {
-+ echo "NOTE: Performing Check of Data Templates\n";
-+}
-+
-+$damaged_template_ids = db_fetch_assoc("SELECT DISTINCT data_template_id
FROM data_template_rrd WHERE hash='' AND local_data_id=0");
-+if (sizeof($damaged_template_ids)) {
-+ foreach($damaged_template_ids as $id) {
$template_name = db_fetch_cell("SELECT name FROM
data_template WHERE id=" . $id["data_template_id"]);
-+ echo "NOTE: Data Template '$template_name' is Damaged and can
be repaired\n";
-+ }
-+
-+ $damaged_templates = db_fetch_assoc("SELECT * FROM data_template_rrd
WHERE hash='' AND local_data_id=0");
-+ if (sizeof($damaged_templates)) {
-+ echo "NOTE: -- Damaged Data Templates Objects Found is '" .
sizeof($damaged_templates) . "'\n";
-+ if ($execute) {
-+ foreach($damaged_templates as $template) {
-+ $hash =
get_hash_data_template($template["local_data_template_rrd_id"],
"data_template_item");
-+ db_execute("UPDATE data_template_rrd SET
hash='$hash' WHERE id=" . $template["id"]);
-+ }
-+ }
-+ }
-+} else {
-+ echo "NOTE: No Damaged Data Templates Found\n";
-+}
-+
-+/* reset the array */
-+$damaged_templates = array();
-+
-+/* repair graph templates */
-+if ($execute) {
-+ echo "NOTE: Repairing Graph Templates\n";
-+} else {
-+ echo "NOTE: Performing Check of Graph Templates\n";
-+}
-+
-+$damaged_template_ids = db_fetch_assoc("SELECT DISTINCT graph_template_id
FROM graph_template_input WHERE hash=''");
-+if (sizeof($damaged_template_ids)) {
-+ foreach($damaged_template_ids as $id) {
-+ $template_name = db_fetch_cell("SELECT name FROM
graph_templates WHERE id=" . $id["graph_template_id"]);
-+ echo "NOTE: Graph Template '$template_name' is Damaged and
can be repaired\n";
-+ }
-+
-+ $damaged_templates = db_fetch_assoc("SELECT * FROM
graph_template_input WHERE hash=''");
-+ if (sizeof($damaged_templates)) {
-+ echo "NOTE: -- Damaged Graph Templates Objects Found is '" .
sizeof($damaged_templates) . "'\n";
-+ if ($execute) {
-+ foreach($damaged_templates as $template) {
-+ $hash = get_hash_graph_template(0,
"graph_template_input");
-+ db_execute("UPDATE graph_template_input SET
hash='$hash' WHERE id=" . $template["id"]);
-+ }
-+ }
-+ }
-+} else {
-+ echo "NOTE: No Damaged Graph Templates Found\n";
-+}
-+
-+
-+/* display_help - displays the usage of the function */
-+function display_help () {
-+ print "Cacti Database Template Repair Tool v1.0, Copyright 2004-2009
- The Cacti Group\n\n";
-+ print "usage: repair_templates.php --execute [--help]\n\n";
-+ print "--execute - Perform the repair\n";
-+ print "--help - display this help message\n";
-+}
-+?>
-diff -ruBbd 0.8.7e/docs/README 0.8.7/docs/README
---- 0.8.7e/docs/README 2009-08-18 21:57:30.000000000 -0400
-+++ 0.8.7/docs/README 2009-08-18 21:58:09.000000000 -0400
-@@ -90,6 +90,9 @@
- table
- poller_reindex_hosts.php - Cause data query reindex on hosts
- rebuild_poller_cache.php - Rebuilds the poller cache
-+ repair_templates.php - Certain templates, when created using the
"duplicate"
-+ function in Cacti, do not import/export well. This utility repairs
-+ those templates.
-
-
-
-diff -ruBbd 0.8.7e/lib/export.php 0.8.7/lib/export.php
---- 0.8.7e/lib/export.php 2009-08-18 21:56:47.000000000 -0400
-+++ 0.8.7/lib/export.php 2009-08-18 21:57:50.000000000 -0400
-@@ -811,7 +811,9 @@
- }
-
- function xml_character_encode($text) {
--
-+ if (function_exists("htmlspecialchars")) {
-+ return htmlspecialchars($text, ENT_QUOTES, "UTF-8");
-+ } else {
- $text = str_replace("&", "&amp;", $text);
- $text = str_replace(">", "&gt;", $text);
- $text = str_replace("<", "&lt;", $text);
-@@ -819,6 +821,7 @@
- $text = str_replace("\'", "&apos;", $text);
-
- return $text;
-+ }
- }
-
- ?>
-diff -ruBbd 0.8.7e/lib/import.php 0.8.7/lib/import.php
---- 0.8.7e/lib/import.php 2009-08-18 21:56:59.000000000 -0400
-+++ 0.8.7/lib/import.php 2009-08-18 21:57:55.000000000 -0400
-@@ -36,10 +36,6 @@
- return $info_array;
- }
-
-- if (isset($xml_array["name"])) {
-- $xml_array["name"] = htmlspecialchars($xml_array["name"]);
-- }
--
- while (list($hash, $hash_array) = each($xml_array)) {
- /* parse information from the hash */
- $parsed_hash = parse_xml_hash($hash);
-@@ -115,7 +111,7 @@
- $_graph_template_id = db_fetch_cell("select id from graph_templates
where hash='$hash'");
- $save["id"] = (empty($_graph_template_id) ? "0" :
$_graph_template_id);
- $save["hash"] = $hash;
-- $save["name"] = htmlspecialchars($xml_array["name"]);
-+ $save["name"] = $xml_array["name"];
- $graph_template_id = sql_save($save, "graph_templates");
-
- $hash_cache["graph_template"][$hash] = $graph_template_id;
-@@ -914,9 +910,13 @@
- }
-
- function xml_character_decode($text) {
-+ if (function_exists("html_entity_decode")) {
-+ return html_entity_decode($text, ENT_QUOTES, "UTF-8");
-+ } else {
- $trans_tbl = get_html_translation_table(HTML_ENTITIES);
- $trans_tbl = array_flip($trans_tbl);
- return strtr($text, $trans_tbl);
-+ }
- }
-
- ?>
-diff -ruBbd 0.8.7e/lib/utility.php 0.8.7/lib/utility.php
---- 0.8.7e/lib/utility.php 2009-08-18 21:57:08.000000000 -0400
-+++ 0.8.7/lib/utility.php 2009-08-18 21:58:00.000000000 -0400
-@@ -346,6 +346,7 @@
- $save["name"] = $graph_template_input["name"];
- $save["description"] =
$graph_template_input["description"];
- $save["column_name"] =
$graph_template_input["column_name"];
-+ $save["hash"] =
get_hash_graph_template(0, "graph_template_input");
-
- $graph_template_input_id = sql_save($save,
"graph_template_input");
-
-@@ -436,6 +437,11 @@
- $save["local_data_id"] = (isset($local_data_id) ?
$local_data_id : 0);
- $save["local_data_template_rrd_id"] =
(isset($data_template_rrd["local_data_template_rrd_id"]) ?
$data_template_rrd["local_data_template_rrd_id"] : 0);
- $save["data_template_id"] = (!empty($_local_data_id) ?
$data_template_rrd["data_template_id"] : $data_template_id);
-+ if ($save["local_data_id"] == 0) {
-+ $save["hash"] =
get_hash_data_template($data_template_rrd["local_data_template_rrd_id"],
"data_template_item");
-+ } else {
-+ $save["hash"] = '';
-+ }
-
- while (list($field, $array) = each($struct_data_source_item))
{
- $save{$field} = $data_template_rrd{$field};
diff --git a/net/spine/HISTORY b/net/spine/HISTORY
index fb129a0..1713793 100644
--- a/net/spine/HISTORY
+++ b/net/spine/HISTORY
@@ -1,5 +1,7 @@
2010-05-21 Vlad Glagolev <stealth AT sourcemage.org>
- * PRE_BUILD: fixed compilation with newer autotools
+ * PRE_BUILD: fixed compilation with newer autotools; apply the patch
+ * INSTALL: added, to properly install config file
+ * config.patch: don't trash /etc/spine.conf

2010-04-06 Philippe "Puppet_Master" Caseiro <puppetmaster AT sourcemage.org>
* DEPENDS: updated mysql dependency to MYSQL provider
diff --git a/net/spine/INSTALL b/net/spine/INSTALL
new file mode 100755
index 0000000..283f5a5
--- /dev/null
+++ b/net/spine/INSTALL
@@ -0,0 +1,3 @@
+default_install &&
+
+install_config_file "$SOURCE_DIRECTORY/spine.conf"
"$INSTALL_ROOT/etc/spine.conf"
diff --git a/net/spine/PRE_BUILD b/net/spine/PRE_BUILD
index 17ac429..66c1a66 100755
--- a/net/spine/PRE_BUILD
+++ b/net/spine/PRE_BUILD
@@ -1,10 +1,12 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&

-libtoolize --force &&
-# note no `&&' here to pass scripts' regeneration
-automake --add-missing
+patch -p0 < "$SPELL_DIRECTORY/config.patch" &&

-for patch in "$SPELL_DIRECTORY/patches"/*.patch; do
- patch -p1 < $patch
-done
+libtoolize --copy --force --install &&
+
+if [[ -d "$SPELL_DIRECTORY/patches" ]]; then
+ for patch in "$SPELL_DIRECTORY/patches"/*.patch; do
+ patch -p1 < $patch
+ done
+fi
diff --git a/net/spine/config.patch b/net/spine/config.patch
new file mode 100644
index 0000000..808eb3a
--- /dev/null
+++ b/net/spine/config.patch
@@ -0,0 +1,11 @@
+--- Makefile.am.orig 2009-06-29 06:03:36.000000000 +0400
++++ Makefile.am 2010-05-21 19:53:22.980952845 +0400
+@@ -2,7 +2,4 @@
+
+ spine_SOURCES = sql.c spine.c util.c snmp.c locks.c poller.c nft_popen.c
php.c ping.c keywords.c error.c
+
+-configdir = $(sysconfdir)
+-config_DATA = spine.conf
+-
+ bin_PROGRAMS = spine
+\ No newline at end of file



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (38106cbc6350ead8b1c5a3152fcb6dd2c6c33a94), Vlad Glagolev, 05/21/2010

Archive powered by MHonArc 2.6.24.

Top of Page