File project.diff of Package rrdtool
--- rrdtool-tclsegfault.patch.orig
+++ rrdtool-tclsegfault.patch
@@ -1,9 +1,9 @@
-Index: bindings/tcl/tclrrd.c
+Index: rrdtool-1.8.0/bindings/tcl/tclrrd.c
===================================================================
---- bindings/tcl/tclrrd.c.orig
-+++ bindings/tcl/tclrrd.c
-@@ -472,6 +472,12 @@ static int Rrd_Graph(
- char **argv2;
+--- rrdtool-1.8.0.orig/bindings/tcl/tclrrd.c
++++ rrdtool-1.8.0/bindings/tcl/tclrrd.c
+@@ -561,6 +561,12 @@ static int Rrd_Graph(
+ const char **argv2;
CONST84 char *save;
+ if (argc < 2) {
@@ -15,16 +15,16 @@ Index: bindings/tcl/tclrrd.c
/*
* If the "filename" is a Tcl fileID, then arrange for rrd_graph() to write to
* that file descriptor. Will this work with windoze? I have no idea.
-@@ -597,6 +603,12 @@ static int Rrd_Resize(
+@@ -680,6 +686,12 @@ static int Rrd_Resize(
+ int argc,
+ CONST84 char *argv[])
{
- char **argv2;
-
+ if (argc < 2) {
+ Tcl_AppendResult(interp, "RRD Error: needs rrd filename",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
- argv2 = getopt_init(argc, argv);
- rrd_resize(argc, argv2);
- getopt_cleanup(argc, argv2);
+ rrd_resize(argc, argv);
+
+ if (rrd_test_error()) {
--- rrdtool.changes.orig
+++ rrdtool.changes
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Mon Dec 25 16:44:37 UTC 2023 - Michal Suchanek <msuchanek@suse.com>
+
+- Constify argv (https://github.com/oetiker/rrdtool-1.x/pull/1242)
+ * Add rrdtool-Constify-argv-fix-warnings.-1242.patch
+ * Refresh rrdtool-tclsegfault.patch
+
+-------------------------------------------------------------------
+Mon Dec 25 16:26:00 UTC 2023 - Michal Suchanek <msuchanek@suse.com>
+
+- Use autosetup
+
+-------------------------------------------------------------------
Wed Mar 22 12:56:56 UTC 2023 - Adam Majer <adam.majer@suse.de>
- Decouple e59f703bbcc0af949ee365206426b6394c340c6f.patch from
--- rrdtool.spec.orig
+++ rrdtool.spec
@@ -1,7 +1,7 @@
#
# spec file for package rrdtool
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -46,10 +46,13 @@ Source99: %{name}.changes
# PATCH-FIX-UPSTREAM -- Fix BUILD_DATE in rrdtool help output (fix segfault)
# https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f.patch
Patch1: e59f703bbcc0af949ee365206426b6394c340c6f.patch
+# PATCH-FIX-UPSTREAM -- Prevent warnings when building against librrd
+Patch2: rrdtool-Constify-argv-fix-warnings.-1242.patch
# PATCH-FIX-UPSTREAM -- Prevent possible segfault
Patch3: rrdtool-tclsegfault.patch
# PATCH-FIX-UPSTREAM -- bnc#793636
Patch12: rrdtool-zero_vs_nothing.patch
+Patch14: harden_rrdcached.service.patch
# Needed for tests
BuildRequires: bc
BuildRequires: cairo-devel >= 1.2
@@ -68,7 +71,6 @@ BuildRequires: python-rpm-macros
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
Requires: dejavu
-Patch14: harden_rrdcached.service.patch
%if %{with python}
BuildRequires: %{python}-devel
BuildRequires: %{python}-setuptools
@@ -214,11 +216,7 @@ big setups in mind which usually runs in
daemon was written to alleviate these problems.
%prep
-%setup -q
-%patch1 -p1
-%patch3
-%patch12 -p1
-%patch14 -p1
+%autosetup -p1
# rrd_tool/rrd_cgi: use the date of the last change
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"