From 6e8a8195eca375186582adc4c558049bf17ba581 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 1 Feb 2023 12:52:09 +0100 Subject: [PATCH] fix 2.8.0 cyberpower regression (#2162568) --- nut-2.8.0-cyberpowertable.patch | 42 +++++++++++++++++++++++++++++++++ nut.spec | 7 +++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 nut-2.8.0-cyberpowertable.patch diff --git a/nut-2.8.0-cyberpowertable.patch b/nut-2.8.0-cyberpowertable.patch new file mode 100644 index 0000000..fa61ee4 --- /dev/null +++ b/nut-2.8.0-cyberpowertable.patch @@ -0,0 +1,42 @@ +From 6a6888e9b5fd995e79e3db335ff4c9c524f31b51 Mon Sep 17 00:00:00 2001 +From: Jim Klimov +Date: Tue, 24 May 2022 00:51:58 +0200 +Subject: [PATCH] Update cyberpower-mib.c + +Closes: #1427 +--- + drivers/cyberpower-mib.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/cyberpower-mib.c b/drivers/cyberpower-mib.c +index aa43295a31..cff6d64d88 100644 +--- a/drivers/cyberpower-mib.c ++++ b/drivers/cyberpower-mib.c +@@ -24,7 +24,7 @@ + + #include "cyberpower-mib.h" + +-#define CYBERPOWER_MIB_VERSION "0.51" ++#define CYBERPOWER_MIB_VERSION "0.52" + #define CYBERPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.3808.1.1.1.1.1.1.0" + + /* CPS-MIB::ups */ +@@ -33,7 +33,6 @@ + /* https://www.cyberpowersystems.com/products/software/mib-files/ */ + /* Per CPS MIB 2.9 upsBaseOutputStatus OBJECT-TYPE: */ + static info_lkp_t cyberpower_power_status[] = { +- { 1, "NULL", NULL, NULL }, /* unknown */ + { 2, "OL", NULL, NULL }, /* onLine */ + { 3, "OB", NULL, NULL }, /* onBattery */ + { 4, "OL BOOST", NULL, NULL }, /* onBoost */ +@@ -44,6 +43,10 @@ static info_lkp_t cyberpower_power_status[] = { + { 9, "OL BYPASS", NULL, NULL }, /* onBypass */ + { 10, "OL TRIM", NULL, NULL }, /* onBuck */ + { 11, "OL OVER", NULL, NULL }, /* onOverload */ ++ ++ /* Note: a "NULL" string must be last due to snmp-ups.c parser logic */ ++ { 1, "NULL", NULL, NULL }, /* unknown */ ++ + { 0, NULL, NULL, NULL } + } ; + diff --git a/nut.spec b/nut.spec index 059600d..b9810e1 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ and GPLv3+ Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -35,6 +35,7 @@ Patch12: nut-2.7.4-scratchdes.patch Patch13: nut-c99-c_attribute.patch Patch14: nut-c99-ax_c_printf_null.patch Patch15: nut-c99-strdup.patch +Patch16: nut-2.8.0-cyberpowertable.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -150,6 +151,7 @@ necessary to develop NUT client applications. %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 -b .cyberpowertable sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in @@ -481,6 +483,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Feb 01 2023 Michal Hlavinka - 2.8.0-9 +- fix 2.8.0 cyberpower regression (#2162568) + * Wed Jan 04 2023 Michal Hlavinka - 2.8.0-8 - move upslog to nut-client, some small spec file changes (#2156504)