From a964cc6044c70be737edfb630ca43f786c0727cc Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sat, 10 Feb 2024 20:44:46 -0500 Subject: [PATCH] Adapt to constification of argv parameters in rrdtool The fix for rrdtool with GCC 14 essential changed the API, and rebuilding lm_sensors now against that rrdtool build (which is only in F40 and ELN) now fails. Therefore, this patch is applied only for affected versions. https://github.com/lm-sensors/lm-sensors/pull/483 https://github.com/oetiker/rrdtool-1.x/pull/1242 https://src.fedoraproject.org/rpms/rrdtool/c/508fac528549a3e31c23948aaa57bc01a709863c --- lm_sensors-3.6.0-rrd-const-argv.patch | 26 ++++++++++++++++++++++++++ lm_sensors.spec | 10 +++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 lm_sensors-3.6.0-rrd-const-argv.patch diff --git a/lm_sensors-3.6.0-rrd-const-argv.patch b/lm_sensors-3.6.0-rrd-const-argv.patch new file mode 100644 index 0000000..730c499 --- /dev/null +++ b/lm_sensors-3.6.0-rrd-const-argv.patch @@ -0,0 +1,26 @@ +All uses of argv in rrdtool have been constified upstream: + +https://github.com/oetiker/rrdtool-1.x/pull/1242 +https://github.com/lm-sensors/lm-sensors/pull/483 + +diff -up ./prog/sensord/rrd.c.orig ./prog/sensord/rrd.c +--- ./prog/sensord/rrd.c.orig 2024-02-05 14:53:34.885969256 -0500 ++++ ./prog/sensord/rrd.c 2024-02-05 14:55:09.337587596 -0500 +@@ -299,7 +299,7 @@ int rrdInit(void) + argv[argc++] = rraBuff; + argv[argc] = NULL; + +- ret = rrd_create(argc, (char**) argv); ++ ret = rrd_create(argc, argv); + if (ret == -1) { + sensorLog(LOG_ERR, "Error creating RRD file: %s: %s", + sensord_args.rrdFile, rrd_get_error()); +@@ -455,7 +455,7 @@ int rrdUpdate(void) + const char *argv[] = { + "sensord", sensord_args.rrdFile, rrdBuff, NULL + }; +- if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) { ++ if ((ret = rrd_update(3, /* WEAK */ argv))) { + sensorLog(LOG_ERR, "Error updating RRD file: %s: %s", + sensord_args.rrdFile, rrd_get_error()); + } diff --git a/lm_sensors.spec b/lm_sensors.spec index 0bf5cc5..136fed1 100644 --- a/lm_sensors.spec +++ b/lm_sensors.spec @@ -1,6 +1,6 @@ Name: lm_sensors Version: 3.6.0 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Hardware monitoring tools %define upstream_version %(echo %{version} | sed -e 's/\\./-/g') @@ -33,6 +33,8 @@ Patch1: 0001-Change-PIDFile-path-from-var-run-to-run.patch Patch2: lm_sensors-3.6.0-allow_no_sensors.patch # Upstream commit 5deee7d0c301df779: Patch3: lm_sensors-3.6.0-sensors-detect-Add-support-for-AMD-CPU-Family-19h.patch +# rrdtool has constified all argv +Patch4: lm_sensors-3.6.0-rrd-const-argv.patch Requires: /usr/sbin/modprobe %ifarch %{ix86} x86_64 @@ -90,6 +92,9 @@ database, and warns of sensor alarms. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 +%patch -P4 -p1 +%endif # Remove currently unused files to make sure we've got the license right rm -f prog/init/sysconfig-lm_sensors-convert prog/hotplug/unhide_ICH_SMBus @@ -212,6 +217,9 @@ fi %changelog +* Sun Feb 11 2024 Yaakov Selkowitz - 3.6.0-17 +- Adapt to constification of argv parameters in rrdtool + * Thu Jan 25 2024 Fedora Release Engineering - 3.6.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild