From d91dc13ba2d109657b28ee8b22ea088f2c6166ce Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Thu, 1 May 2008 01:44:24 +0000 Subject: [PATCH] - Fix problem with cairo_save/cairo_restore (#444827) - Fix python bindings rrdtool info implementation (#435468) --- rrdtool-1.3beta4-fix-cairo.patch | 65 +++++++++++++++++++ ...ta4-fix-python-bindings-rrdtool-info.patch | 36 ++++++++++ rrdtool.spec | 12 +++- 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 rrdtool-1.3beta4-fix-cairo.patch create mode 100644 rrdtool-1.3beta4-fix-python-bindings-rrdtool-info.patch diff --git a/rrdtool-1.3beta4-fix-cairo.patch b/rrdtool-1.3beta4-fix-cairo.patch new file mode 100644 index 0000000..beab993 --- /dev/null +++ b/rrdtool-1.3beta4-fix-cairo.patch @@ -0,0 +1,65 @@ +diff -Naurp rrdtool-1.2.99908020600/src/rrd_graph.c rrdtool-1.2.99908020600.fix/src/rrd_graph.c +--- rrdtool-1.2.99908020600/src/rrd_graph.c 2008-02-05 19:14:25.000000000 -0500 ++++ rrdtool-1.2.99908020600.fix/src/rrd_graph.c 2008-04-30 21:12:13.000000000 -0400 +@@ -3345,34 +3345,36 @@ int graph_paint( + switch (im->gdes[i].gf) { + case GF_HRULE: + if (im->gdes[i].yrule >= im->minval +- && im->gdes[i].yrule <= im->maxval) +- cairo_save(im->cr); +- if (im->gdes[i].dash) { +- cairo_set_dash(im->cr, im->gdes[i].p_dashes, +- im->gdes[i].ndash, im->gdes[i].offset); +- } +- gfx_line(im, +- im->xorigin, ytr(im, im->gdes[i].yrule), +- im->xorigin + im->xsize, ytr(im, +- im->gdes[i].yrule), +- 1.0, im->gdes[i].col); +- cairo_stroke(im->cr); +- cairo_restore(im->cr); ++ && im->gdes[i].yrule <= im->maxval) { ++ cairo_save(im->cr); ++ if (im->gdes[i].dash) { ++ cairo_set_dash(im->cr, im->gdes[i].p_dashes, ++ im->gdes[i].ndash, im->gdes[i].offset); ++ } ++ gfx_line(im, ++ im->xorigin, ytr(im, im->gdes[i].yrule), ++ im->xorigin + im->xsize, ytr(im, ++ im->gdes[i].yrule), ++ 1.0, im->gdes[i].col); ++ cairo_stroke(im->cr); ++ cairo_restore(im->cr); ++ } + break; + case GF_VRULE: + if (im->gdes[i].xrule >= im->start +- && im->gdes[i].xrule <= im->end) +- cairo_save(im->cr); +- if (im->gdes[i].dash) { +- cairo_set_dash(im->cr, im->gdes[i].p_dashes, +- im->gdes[i].ndash, im->gdes[i].offset); +- } +- gfx_line(im, +- xtr(im, im->gdes[i].xrule), im->yorigin, +- xtr(im, im->gdes[i].xrule), +- im->yorigin - im->ysize, 1.0, im->gdes[i].col); +- cairo_stroke(im->cr); +- cairo_restore(im->cr); ++ && im->gdes[i].xrule <= im->end) { ++ cairo_save(im->cr); ++ if (im->gdes[i].dash) { ++ cairo_set_dash(im->cr, im->gdes[i].p_dashes, ++ im->gdes[i].ndash, im->gdes[i].offset); ++ } ++ gfx_line(im, ++ xtr(im, im->gdes[i].xrule), im->yorigin, ++ xtr(im, im->gdes[i].xrule), ++ im->yorigin - im->ysize, 1.0, im->gdes[i].col); ++ cairo_stroke(im->cr); ++ cairo_restore(im->cr); ++ } + break; + default: + break; diff --git a/rrdtool-1.3beta4-fix-python-bindings-rrdtool-info.patch b/rrdtool-1.3beta4-fix-python-bindings-rrdtool-info.patch new file mode 100644 index 0000000..3a3ac12 --- /dev/null +++ b/rrdtool-1.3beta4-fix-python-bindings-rrdtool-info.patch @@ -0,0 +1,36 @@ +Index: rrdtool/bindings/python/rrd_extra.h +=================================================================== +--- rrdtool/bindings/python/rrd_extra.h (revision 1306) ++++ rrdtool/bindings/python/rrd_extra.h (revision 1332) +@@ -54,5 +54,4 @@ + int rrd_open( + char *file_name, +- FILE ** in_file, + rrd_t *rrd, + int rdwr); +Index: rrdtool/bindings/python/rrdtoolmodule.c +=================================================================== +--- rrdtool/bindings/python/rrdtoolmodule.c (revision 1306) ++++ rrdtool/bindings/python/rrdtoolmodule.c (revision 1332) +@@ -412,5 +412,4 @@ + PyObject *r, *t, *ds; + rrd_t rrd; +- FILE *in_file; + char *filename; + unsigned long i, j; +@@ -419,10 +418,9 @@ + return NULL; + +- if (rrd_open(filename, &in_file, &rrd, RRD_READONLY) == -1) { +- PyErr_SetString(ErrorObject, rrd_get_error()); +- rrd_clear_error(); +- return NULL; +- } +- fclose(in_file); ++ if (!rrd_open(filename, &rrd, RRD_READONLY) == -1) { ++ PyErr_SetString(ErrorObject, rrd_get_error()); ++ rrd_clear_error(); ++ return NULL; ++ } + + #define DICTSET_STR(dict, name, value) \ diff --git a/rrdtool.spec b/rrdtool.spec index f2f6145..7c5c04a 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -10,7 +10,7 @@ Summary: Round Robin Database Tool to store and display time-series data Name: rrdtool Version: 1.3 -Release: 0.11.%{betaver}%{?dist} +Release: 0.13.%{betaver}%{?dist} License: GPLv2+ with exceptions Group: Applications/Databases URL: http://oss.oetiker.ch/rrdtool/ @@ -18,6 +18,8 @@ URL: http://oss.oetiker.ch/rrdtool/ Source0: http://oss.oetiker.ch/rrdtool/pub/beta/%{name}-%{version}%{betaver}.tar.gz Source1: php4-%{svnrev}.tar.gz Patch1: rrdtool-1.3.0-beta4-fix-rrd_update-in-php-bindings.patch +Patch2: rrdtool-1.3beta4-fix-python-bindings-rrdtool-info.patch +Patch3: rrdtool-1.3beta4-fix-cairo.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: dejavu-lgc-fonts BuildRequires: gcc-c++, openssl-devel, freetype-devel @@ -144,6 +146,8 @@ The %{name}-ruby package includes RRDtool bindings for Ruby. %if %{with_php} %patch1 -p1 %endif +%patch2 -p1 +%patch3 -p1 # Fix to find correct python dir on lib64 %{__perl} -pi -e 's|get_python_lib\(0,0,prefix|get_python_lib\(1,0,prefix|g' \ @@ -324,6 +328,12 @@ find examples/ -type f -exec chmod 0644 {} \; %endif %changelog +* Wed Apr 30 2008 Jarod Wilson 1.3.0-0.13.beta4 +- Fix problem with cairo_save/cairo_restore (#444827) + +* Wed Apr 23 2008 Jarod Wilson 1.3.0-0.12.beta4 +- Fix python bindings rrdtool info implementation (#435468) + * Tue Apr 08 2008 Jarod Wilson 1.3.0-0.11.beta4 - Work around apparent version string length issue w/perl 5.10 (#441359)