[Pkg-net-snmp-commits] r303 - branches/net-snmp54/debian branches/net-snmp54/debian/patches branches/net-snmp54-dev/debian trunk/debian
Jochen Friedrich
jochen at alioth.debian.org
Thu Nov 12 15:26:17 UTC 2009
Author: jochen
Date: 2009-11-12 15:26:17 +0000 (Thu, 12 Nov 2009)
New Revision: 303
Added:
branches/net-snmp54/debian/patches/60_libsensors_api.README
branches/net-snmp54/debian/patches/60_libsensors_api.patch
Modified:
branches/net-snmp54-dev/debian/control
branches/net-snmp54-dev/debian/rules
branches/net-snmp54/debian/changelog
branches/net-snmp54/debian/control
branches/net-snmp54/debian/patches/series
branches/net-snmp54/debian/rules
trunk/debian/control
trunk/debian/rules
Log:
Add patch from Jonathan Nieder <jrnieder at gmail.com> to update lmsensors API to libsensors4.
Modified: branches/net-snmp54/debian/changelog
===================================================================
--- branches/net-snmp54/debian/changelog 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54/debian/changelog 2009-11-12 15:26:17 UTC (rev 303)
@@ -1,3 +1,14 @@
+net-snmp (5.4.2.1~dfsg-2) unstable; urgency=low
+
+ * Add upstream patch R17470 to fix debugging output and numeric OID
+ reporting. (Closes: #524203, #509562) Thanks to Luca Ferroni
+ <luca.ferroni at labs.it> for the patch.
+ * Fix long description of debug package.
+ * Switch to libsensors4. (Closes: #518898) Thanks to Jonathan Nieder
+ <jrnieder at gmail.com> for the patch.
+
+ -- Jochen Friedrich <jochen at scram.de> Thu, 12 Nov 2009 16:17:40 +0100
+
net-snmp (5.4.2.1~dfsg-1) unstable; urgency=low
* New upstream version
Modified: branches/net-snmp54/debian/control
===================================================================
--- branches/net-snmp54/debian/control 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54/debian/control 2009-11-12 15:26:17 UTC (rev 303)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Net-SNMP Packaging Team <pkg-net-snmp-devel at lists.alioth.debian.org>
Uploaders: Jochen Friedrich <jochen at scram.de>, Thomas Anders <tanders at users.sourceforge.net>, Noah Meyerhans <noahm at debian.org>
-Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors-dev (>=2.8.5) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors4-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
Standards-Version: 3.8.3
Vcs-Svn: svn://svn.debian.org/pkg-net-snmp/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-net-snmp/
Added: branches/net-snmp54/debian/patches/60_libsensors_api.README
===================================================================
--- branches/net-snmp54/debian/patches/60_libsensors_api.README (rev 0)
+++ branches/net-snmp54/debian/patches/60_libsensors_api.README 2009-11-12 15:26:17 UTC (rev 303)
@@ -0,0 +1 @@
+Patch from Jonathan Nieder <jrnieder at gmail.com> to update lmsensors API to libsensors4.
Added: branches/net-snmp54/debian/patches/60_libsensors_api.patch
===================================================================
--- branches/net-snmp54/debian/patches/60_libsensors_api.patch (rev 0)
+++ branches/net-snmp54/debian/patches/60_libsensors_api.patch 2009-11-12 15:26:17 UTC (rev 303)
@@ -0,0 +1,251 @@
+diff --git a/agent/mibgroup/ucd-snmp/lmSensors.c b/agent/mibgroup/ucd-snmp/lmSensors.c
+index d7dbd98..8f9fcd2 100644
+--- a/agent/mibgroup/ucd-snmp/lmSensors.c
++++ b/agent/mibgroup/ucd-snmp/lmSensors.c
+@@ -390,7 +390,7 @@ static int
+ sensor_load(void)
+ {
+ int rc = 0;
+- time_t t = time(NULL);
++ time_t t = time(NULL);
+
+ if (t > timestamp + 7) /* this may require some tuning - currently 7 seconds*/
+ {
+@@ -962,77 +962,78 @@ else{
+ } /* end for */
+
+ while ((chip = sensors_get_detected_chips(&chip_nr))) {
+- int a = 0;
+- int b = 0;
++ int a = 0;
++ int b = 0;
+
+- while ((data = sensors_get_all_features(*chip, &a, &b))) {
+- char *label = NULL;
+- double val;
++ while ((data = sensors_get_all_features(*chip, &a, &b))) {
++ char *label = NULL;
++ double val;
+
+- if ((data->mode & SENSORS_MODE_R) &&
+- (data->mapping == SENSORS_NO_MAPPING) &&
+- !sensors_get_label(*chip, data->number, &label) &&
+- !sensors_get_feature(*chip, data->number, &val)) {
+- int type = -1;
+- float mul;
+- _sensor_array *array;
++ if ((data->mode & SENSORS_MODE_R) &&
++ (data->mapping == SENSORS_NO_MAPPING) &&
++ !sensors_get_label(*chip, data->number, &label) &&
++ !sensors_get_feature(*chip, data->number, &val)) {
++ int type = -1;
++ float mul;
++ _sensor_array *array;
+
+- /* The label, as determined for a given chip in sensors.conf,
+- * is used to place each sensor in the appropriate bucket.
+- * Volt, Fan, Temp, and Misc. If the text being looked for below
+- * is not in the label of a given sensor (e.g., the temp1 sensor
+- * has been labeled 'CPU' and not 'CPU temp') it will end up being
+- * lumped in the MISC bucket. */
++ /* The label, as determined for a given chip in
++ * sensors.conf, is used to place each sensor in the
++ * appropriate bucket. Volt, Fan, Temp, and Misc.
++ * If the text being looked for below is not in the
++ * label of a given sensor (e.g., the temp1 sensor
++ * has been labeled 'CPU' and not 'CPU temp') it
++ * will end up being lumped in the MISC bucket. */
+
+- if (strstr(label, "V")) {
+- type = VOLT_TYPE;
+- mul = 1000.0;
+- }
+- if (strstr(label, "fan") || strstr(label, "Fan")) {
+- type = FAN_TYPE;
+- mul = 1.0;
+- }
+- if (strstr(label, "temp") || strstr(label, "Temp")) {
+- type = TEMP_TYPE;
+- mul = 1000.0;
+- }
+- if (type == -1) {
+- type = MISC_TYPE;
+- mul = 1000.0;
+- }
++ if (strstr(label, "V")) {
++ type = VOLT_TYPE;
++ mul = 1000.0;
++ }
++ if (strstr(label, "fan") || strstr(label, "Fan")) {
++ type = FAN_TYPE;
++ mul = 1.0;
++ }
++ if (strstr(label, "temp") || strstr(label, "Temp")) {
++ type = TEMP_TYPE;
++ mul = 1000.0;
++ }
++ if (type == -1) {
++ type = MISC_TYPE;
++ mul = 1000.0;
++ }
+
+- array = &sensor_array[type];
+- if ( array->current_len <= array->n) {
+- _sensor* old_buffer = array->sensor;
+- size_t new_size = (sizeof(_sensor) * array->current_len) + (sizeof(_sensor) * DEFAULT_SENSORS);
+- array->sensor = (_sensor*)realloc(array->sensor, new_size);
+- if (array->sensor == NULL)
+- {
+- /* Continuing would be unsafe */
+- snmp_log(LOG_ERR, "too many sensors to fit, and failed to alloc more, failing on %s\n", label);
+- free(old_buffer);
+- old_buffer = NULL;
+- if (label) {
+- free(label);
+- label = NULL;
+- } /* end if label */
+- return (rc=1);
+- } /* end if array->sensor */
+- array->current_len = new_size / sizeof(_sensor);
+- DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, array->current_len));
+- } /* end if array->current */
+- strncpy(array->sensor[array->n].name, label, MAX_NAME);
+- array->sensor[array->n].value = (int) (val * mul);
+- DEBUGMSGTL(("sensors","sensor %d, value %d\n",
+- array->sensor[array->n].name,
+- array->sensor[array->n].value));
+- array->n++;
+- } /* end if data-mode */
+- if (label) {
+- free(label);
+- label = NULL;
+- } /* end if label */
+- } /* end while data */
++ array = &sensor_array[type];
++ if ( array->current_len <= array->n) {
++ _sensor* old_buffer = array->sensor;
++ size_t new_size = (sizeof(_sensor) * array->current_len) + (sizeof(_sensor) * DEFAULT_SENSORS);
++ array->sensor = (_sensor*)realloc(array->sensor, new_size);
++ if (array->sensor == NULL)
++ {
++ /* Continuing would be unsafe */
++ snmp_log(LOG_ERR, "too many sensors to fit, and failed to alloc more, failing on %s\n", label);
++ free(old_buffer);
++ old_buffer = NULL;
++ if (label) {
++ free(label);
++ label = NULL;
++ } /* end if label */
++ return (rc=1);
++ } /* end if array->sensor */
++ array->current_len = new_size / sizeof(_sensor);
++ DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, array->current_len));
++ } /* end if array->current */
++ strncpy(array->sensor[array->n].name, label, MAX_NAME);
++ array->sensor[array->n].value = (int) (val * mul);
++ DEBUGMSGTL(("sensors","sensor %d, value %d\n",
++ array->sensor[array->n].name,
++ array->sensor[array->n].value));
++ array->n++;
++ } /* end if data-mode */
++ if (label) {
++ free(label);
++ label = NULL;
++ } /* end if label */
++ } /* end while data */
+ } /* end while chip */
+ return rc;
+ #endif /* end else ie. ifdef everything else */
+diff --git a/agent/mibgroup/ucd-snmp/lmSensors.c b/agent/mibgroup/ucd-snmp/lmSensors.c
+index 8f9fcd2..e42e0e2 100644
+--- a/agent/mibgroup/ucd-snmp/lmSensors.c
++++ b/agent/mibgroup/ucd-snmp/lmSensors.c
+@@ -89,7 +89,6 @@
+ #include </usr/platform/sun4u/include/sys/envctrl.h>
+ #else
+ #include <sensors/sensors.h>
+- #define CONFIG_FILE_NAME "/etc/sensors.conf"
+ #endif
+
+ #include "lmSensors.h"
+@@ -247,7 +246,7 @@ var_lmSensorsTable(struct variable *vp,
+ size_t * var_len, WriteMethod ** write_method)
+ {
+ static long long_ret;
+- static unsigned char string[SPRINT_MAX_LEN];
++ static char string[SPRINT_MAX_LEN];
+
+ int s_index;
+ int s_type = -1;
+@@ -352,9 +351,7 @@ sensor_init(void)
+ {
+ int res;
+ #ifndef solaris2
+- char filename[] = CONFIG_FILE_NAME;
+ time_t t = time(NULL);
+- FILE *fp = fopen(filename, "r");
+ int i = 0;
+
+ DEBUGMSG(("ucd-snmp/lmSensors", "=> sensor_init\n"));
+@@ -366,13 +363,7 @@ sensor_init(void)
+ sensor_array[i].sensor = NULL;
+ }
+
+- if (!fp)
+- {
+- res = 1;
+- goto leaving;
+- }
+-
+- if (sensors_init(fp))
++ if (sensors_init(NULL))
+ {
+ res = 2;
+ goto leaving;
+@@ -940,7 +931,8 @@ else{
+ #else /* end solaris2 only ie. ifdef everything else */
+
+ const sensors_chip_name *chip;
+- const sensors_feature_data *data;
++ const sensors_feature *feature;
++ const sensors_subfeature *subfeature;
+ int chip_nr = 0;
+ int rc = 0;
+ unsigned int i = 0;
+@@ -961,18 +953,19 @@ else{
+ sensor_array[i].current_len = DEFAULT_SENSORS;
+ } /* end for */
+
+- while ((chip = sensors_get_detected_chips(&chip_nr))) {
++ while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+ int a = 0;
++ while ((feature = sensors_get_features(chip, &a))) {
+ int b = 0;
+-
+- while ((data = sensors_get_all_features(*chip, &a, &b))) {
++ while ((subfeature = sensors_get_all_subfeatures(chip,
++ feature, &b))) {
+ char *label = NULL;
+ double val;
+
+- if ((data->mode & SENSORS_MODE_R) &&
+- (data->mapping == SENSORS_NO_MAPPING) &&
+- !sensors_get_label(*chip, data->number, &label) &&
+- !sensors_get_feature(*chip, data->number, &val)) {
++ if ((subfeature->flags & SENSORS_MODE_R) &&
++ (subfeature->mapping == 0) &&
++ (label = sensors_get_label(chip, feature)) &&
++ !sensors_get_value(chip, subfeature->number, &val)) {
+ int type = -1;
+ float mul;
+ _sensor_array *array;
+@@ -1033,7 +1026,8 @@ else{
+ free(label);
+ label = NULL;
+ } /* end if label */
+- } /* end while data */
++ } /* end while subfeature */
++ } /* end while feature */
+ } /* end while chip */
+ return rc;
+ #endif /* end else ie. ifdef everything else */
Modified: branches/net-snmp54/debian/patches/series
===================================================================
--- branches/net-snmp54/debian/patches/series 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54/debian/patches/series 2009-11-12 15:26:17 UTC (rev 303)
@@ -13,3 +13,4 @@
57_fix_ipv6_memleak.patch
58_download_mibs.patch
59_fix_python.patch
+60_libsensors_api.patch
Modified: branches/net-snmp54/debian/rules
===================================================================
--- branches/net-snmp54/debian/rules 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54/debian/rules 2009-11-12 15:26:17 UTC (rev 303)
@@ -22,7 +22,7 @@
ifeq (linux,$(DEB_HOST_ARCH_OS))
MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmSensors
IPV6 = --enable-ipv6
-DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors-dev (>= 2.8.5)"
+DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors4-dev"
else
ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
IPV6 = --disable-ipv6
Modified: branches/net-snmp54-dev/debian/control
===================================================================
--- branches/net-snmp54-dev/debian/control 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54-dev/debian/control 2009-11-12 15:26:17 UTC (rev 303)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Net-SNMP Packaging Team <pkg-net-snmp-devel at lists.alioth.debian.org>
Uploaders: Jochen Friedrich <jochen at scram.de>, Thomas Anders <tanders at users.sourceforge.net>, Noah Meyerhans <noahm at debian.org>
-Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors-dev (>=2.8.5) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors4-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
Standards-Version: 3.8.3
Vcs-Svn: svn://svn.debian.org/pkg-net-snmp/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-net-snmp/
Modified: branches/net-snmp54-dev/debian/rules
===================================================================
--- branches/net-snmp54-dev/debian/rules 2009-11-12 14:42:00 UTC (rev 302)
+++ branches/net-snmp54-dev/debian/rules 2009-11-12 15:26:17 UTC (rev 303)
@@ -22,7 +22,7 @@
ifeq (linux,$(DEB_HOST_ARCH_OS))
MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmSensors
IPV6 = --enable-ipv6
-DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors-dev (>= 2.8.5)"
+DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors4-dev"
else
ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
IPV6 = --disable-ipv6
Modified: trunk/debian/control
===================================================================
--- trunk/debian/control 2009-11-12 14:42:00 UTC (rev 302)
+++ trunk/debian/control 2009-11-12 15:26:17 UTC (rev 303)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Net-SNMP Packaging Team <pkg-net-snmp-devel at lists.alioth.debian.org>
Uploaders: Jochen Friedrich <jochen at scram.de>, Thomas Anders <tanders at users.sourceforge.net>, Noah Meyerhans <noahm at debian.org>
-Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors-dev (>=2.8.5) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
+Build-Depends: debhelper (>=7), libtool, libwrap0-dev, libssl-dev (>> 0.9.8), perl (>=5.8), libperl-dev, python-all-dev, python-central (>=0.5.6), python (>=2.3.5-7), python-setuptools (>=0.6b3), autoconf, automake1.9, debianutils (>=1.13.1), bash (>=2.05), findutils (>=4.1.20), procps, cdbs (>=0.4.51), quilt, libkvm-dev [kfreebsd-i386 kfreebsd-amd64], libsensors4-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
Standards-Version: 3.8.3
Vcs-Svn: svn://svn.debian.org/pkg-net-snmp/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-net-snmp/
Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules 2009-11-12 14:42:00 UTC (rev 302)
+++ trunk/debian/rules 2009-11-12 15:26:17 UTC (rev 303)
@@ -22,7 +22,7 @@
ifeq (linux,$(DEB_HOST_ARCH_OS))
MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmSensors
IPV6 = --enable-ipv6
-DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors-dev (>= 2.8.5)"
+DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors4-dev"
else
ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
IPV6 = --disable-ipv6
More information about the Pkg-net-snmp-commits
mailing list