Skip to Content.
Sympa Menu

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

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 (7979d285812e3c7ee4d123abc8791698844b9aa2)
  • Date: Sat, 26 Sep 2009 11:52:31 -0500

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

net/cacti/BUILD | 5
net/cacti/DETAILS | 9 -
net/cacti/HISTORY | 5
net/cacti/PRE_BUILD | 6
net/cacti/patches/cli_add_graph.patch | 11 +
net/cacti/patches/snmp_invalid_response.patch | 25 ++
net/cacti/patches/template_duplication.patch | 234
++++++++++++++++++++++++++
7 files changed, 281 insertions(+), 14 deletions(-)

New commits:
commit 7979d285812e3c7ee4d123abc8791698844b9aa2
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

cacti: moved official patches to patches/ dir

diff --git a/net/cacti/BUILD b/net/cacti/BUILD
index 4209ced..27ba77d 100755
--- a/net/cacti/BUILD
+++ b/net/cacti/BUILD
@@ -1,4 +1 @@
-# apply the official patches
-for patch in `gaze sources $SPELL | grep "\.patch$"`; do
- patch -p1 < "$SOURCE_CACHE/$patch"
-done
+true
diff --git a/net/cacti/DETAILS b/net/cacti/DETAILS
index 4b3b11e..406f921 100755
--- a/net/cacti/DETAILS
+++ b/net/cacti/DETAILS
@@ -1,18 +1,11 @@
SPELL=cacti
VERSION=0.8.7e
SOURCE=$SPELL-$VERSION.tar.gz
-# official patches
- SOURCE1=cli_add_graph.patch
- SOURCE2=snmp_invalid_response.patch
- SOURCE3=template_duplication.patch
- SOURCE1_URL=http://www.cacti.net/downloads/patches/$VERSION/$SOURCE1
- SOURCE2_URL=http://www.cacti.net/downloads/patches/$VERSION/$SOURCE2
- SOURCE3_URL=http://www.cacti.net/downloads/patches/$VERSION/$SOURCE3
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
SOURCE_URL[0]=http://www.cacti.net/downloads/$SOURCE

SOURCE_HASH=sha512:b826381cc5e76f95a9bea32754785121d09da505f139323b7d111321f353d7be9ab8cedc5ae26cea828b23a36ad2fca7c2bcd82f541fc3bf485b209698924fdb
LICENSE[0]=GPL
- WEB_SITE=http://www.cacti.net
+ WEB_SITE=http://www.cacti.net/
ENTERED=20060131
KEYWORDS="net"
SHORT="Network graphing solution"
diff --git a/net/cacti/HISTORY b/net/cacti/HISTORY
index 49591a3..5e179db 100644
--- a/net/cacti/HISTORY
+++ b/net/cacti/HISTORY
@@ -1,6 +1,7 @@
2009-09-26 Vlad Glagolev <stealth AT sourcemage.org>
- * DETAILS: updated spell to 0.8.7e; added official patches
- * BUILD: rewritten logic for applying official patches
+ * DETAILS: updated spell to 0.8.7e; moved official patches to patches/
+ * BUILD: removed patch-applying
+ * PRE_BUILD: added, to apply official patches

2008-01-02 David Kowis <dkowis AT shlrm.org>
* DETAILS: version to 0.8.7a and added official patches
diff --git a/net/cacti/PRE_BUILD b/net/cacti/PRE_BUILD
new file mode 100755
index 0000000..66c1eb8
--- /dev/null
+++ b/net/cacti/PRE_BUILD
@@ -0,0 +1,6 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+
+for patch in "$SPELL_DIRECTORY/patches"/*.patch; do
+ patch -p1 < $patch
+done
diff --git a/net/cacti/patches/cli_add_graph.patch
b/net/cacti/patches/cli_add_graph.patch
new file mode 100644
index 0000000..b82d21a
--- /dev/null
+++ b/net/cacti/patches/cli_add_graph.patch
@@ -0,0 +1,11 @@
+--- ../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/snmp_invalid_response.patch
b/net/cacti/patches/snmp_invalid_response.patch
new file mode 100644
index 0000000..5b2dd20
--- /dev/null
+++ b/net/cacti/patches/snmp_invalid_response.patch
@@ -0,0 +1,25 @@
+--- ../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/template_duplication.patch
b/net/cacti/patches/template_duplication.patch
new file mode 100644
index 0000000..cd6ff4b
--- /dev/null
+++ b/net/cacti/patches/template_duplication.patch
@@ -0,0 +1,234 @@
+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};



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (7979d285812e3c7ee4d123abc8791698844b9aa2), Vlad Glagolev, 09/26/2009

Archive powered by MHonArc 2.6.24.

Top of Page