]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/commitdiff
python-rrdtool: Update to version 0.1.5
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 5 Sep 2016 08:42:58 +0000 (10:42 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 5 Sep 2016 08:42:58 +0000 (10:42 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
python-rrdtool/patches/python-rrdtool-fix-SEGV.patch [deleted file]
python-rrdtool/python-rrdtool.nm

diff --git a/python-rrdtool/patches/python-rrdtool-fix-SEGV.patch b/python-rrdtool/patches/python-rrdtool-fix-SEGV.patch
deleted file mode 100644 (file)
index c45316d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-From a45ed2ad6f92730a479522c46febb1b56b442aba Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Mon, 23 Nov 2015 02:15:33 +0000
-Subject: [PATCH] Fix crash in lastupdate() method
-
-When a RRD database contains floating point values, the
-PyRRD_Int_FromString function returns NULL, which will then be tried
-to be put into a dictionary.
-This operation fails as PyDict_SetItemString does not handle NULL
-and the program crashes with SEGV.
-
-This patch parses the value as a floating point number
-and will add that instead. If the value could not be parsed,
-None will be added instead.
-
-Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
----
- rrdtoolmodule.c | 16 +++++++++++++---
- 1 file changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/rrdtoolmodule.c b/rrdtoolmodule.c
-index dead4ff..4713850 100644
---- a/rrdtoolmodule.c
-+++ b/rrdtoolmodule.c
-@@ -880,9 +880,19 @@ _rrdtool_lastupdate(PyObject *self, PyObject *args)
-         PyDict_SetItemString(ret, "ds", ds_dict);
-         for (i = 0; i < ds_cnt; i++) {
--            PyDict_SetItemString(ds_dict,
--                ds_names[i],
--                PyRRD_Int_FromString(last_ds[i], NULL, 10));
-+            PyObject* val = Py_None;
-+
-+            double num;
-+            if (sscanf(last_ds[i], "%lf", &num) == 1) {
-+                val = PyFloat_FromDouble(num);
-+            }
-+
-+            if (!val)
-+                return NULL;
-+
-+            PyDict_SetItemString(ds_dict, ds_names[i], val);
-+            Py_DECREF(val);
-+
-             free(last_ds[i]);
-             free(ds_names[i]);
-         }
index 7fa8b8b7ae8610baedb9c3cb8796911884c53a15..68045f07762cda7d84edeb77097152c633a6a238 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = python-rrdtool
-version    = 0.1.2
+version    = 0.1.5
 release    = 1
 
 groups     = System/Libraries
@@ -17,7 +17,7 @@ description
        object-oriented way to work with Round Robin Databases.
 end
 
-source_dl  = https://pypi.python.org/packages/source/r/rrdtool/
+source_dl  = https://github.com/commx/python-rrdtool/archive/v%{version}.tar.gz#/
 
 build
        requires