From be7489b3e9acd89f1aca1af1a1e6e24d097724b7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 27 Jan 2024 20:16:27 +0100 Subject: [PATCH 1/5] scripts/python/module/Makefile.am: avoid "make clean" invalidating the NUT build area Otherwise we can not find the test script (generated from .in by configure normally) Signed-off-by: Jim Klimov --- scripts/python/module/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/python/module/Makefile.am b/scripts/python/module/Makefile.am index 0f64340c22..17659223eb 100644 --- a/scripts/python/module/Makefile.am +++ b/scripts/python/module/Makefile.am @@ -25,7 +25,7 @@ GENERATED_DIST = dist build *.egg-info GENERATED_SRC = PyNUTClient README.txt LICENSE-GPL3 # These are normally generated by a NUT build, but if we want to iterate -# specifically PyNUTClient packaging - `make clean dist` should do it here: +# specifically PyNUTClient packaging - `make veryclean dist` should do it here: GENERATED_PY = test_nutclient.py PyNUT.py setup.py # (Re-)generate files normally made by `configure` from .in templates @@ -40,6 +40,8 @@ $(GENERATED_DIST): .pypi-dist clean-local: rm -rf $(GENERATED_SRC) $(GENERATED_DIST) rm -f .pypi-src .pypi-dist* + +veryclean: clean rm -f $(GENERATED_PY) # Python test envs take a while to populate, so maybe better not clean @@ -47,6 +49,7 @@ clean-local: # if this choice proves a problem. distclean-local: rm -rf .tox + rm -f $(GENERATED_PY) MAINTAINERCLEANFILES = Makefile.in .dirstamp .pypi-tools* From b4eca8243c5cd3712cd15cf9555e01cb21b4475e Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 27 Jan 2024 20:17:57 +0100 Subject: [PATCH 2/5] */Makefile.am: standardize to have the export commands on top, just after title comment line Signed-off-by: Jim Klimov --- Makefile.am | 6 +++--- clients/Makefile.am | 3 ++- common/Makefile.am | 14 +++++++------- data/html/Makefile.am | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3aef1e9166..e7f9210e98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,5 @@ # top-level Makefile for NUT -# include directory for aclocal -ACLOCAL_AMFLAGS = -I m4 - # Export certain values for ccache which NUT ci_build.sh can customize, # to facilitate developer iteration re-runs of "make" later. # At least GNU and BSD make implementations are okay with this syntax. @@ -12,6 +9,9 @@ ACLOCAL_AMFLAGS = -I m4 @NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ @NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ +# include directory for aclocal +ACLOCAL_AMFLAGS = -I m4 + # subdirectories to build and distribute. The order matters, as # several subdirectories depend on stuff in "common" or tools being built first SUBDIRS = include common clients conf data docs drivers tools \ diff --git a/clients/Makefile.am b/clients/Makefile.am index 9e294d40e1..c00bea373f 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,5 +1,4 @@ # Network UPS Tools: clients -EXTRA_DIST = # Export certain values for ccache which NUT ci_build.sh can customize, # to facilitate developer iteration re-runs of "make" later. @@ -10,6 +9,8 @@ EXTRA_DIST = @NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ @NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ +EXTRA_DIST = + # nutclient.cpp for some legacy reason (maybe initial detached development?) # optionally includes "common.h" with the NUT build setup - and this option # was never triggered in fact, not until pushed through command line like this: diff --git a/common/Makefile.am b/common/Makefile.am index 8ef2d39ed4..603fd3873f 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,12 +1,5 @@ # Network UPS Tools: common -AM_CFLAGS = -I$(top_srcdir)/include -AM_LDFLAGS = -no-undefined -EXTRA_DIST = - -noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la -libparseconf_la_SOURCES = parseconf.c - # Export certain values for ccache which NUT ci_build.sh can customize, # to facilitate developer iteration re-runs of "make" later. # At least GNU and BSD make implementations are okay with this syntax. @@ -16,6 +9,13 @@ libparseconf_la_SOURCES = parseconf.c @NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ @NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ +AM_CFLAGS = -I$(top_srcdir)/include +AM_LDFLAGS = -no-undefined +EXTRA_DIST = + +noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la +libparseconf_la_SOURCES = parseconf.c + # do not hard depend on '../include/nut_version.h', since it blocks # 'dist', and is only required for actual build, in which case # BUILT_SOURCES (in ../include) will ensure nut_version.h will diff --git a/data/html/Makefile.am b/data/html/Makefile.am index 90fa56fa28..0ef0652637 100644 --- a/data/html/Makefile.am +++ b/data/html/Makefile.am @@ -1,4 +1,5 @@ # Network UPS Tools: data/html + # install these only if configured --with-cgi if WITH_CGI dist_html_DATA = index.html bottom.html nut-banner.png From 76045f9a0217e881996a0c67281966ca4ff7fe70 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 25 Jan 2024 22:39:48 +0100 Subject: [PATCH 3/5] tools/nut-usbinfo.pl: avoid dying on unknown file name patterns (e.g. *-mib.c.bak), just warn and skip them Signed-off-by: Jim Klimov --- tools/nut-usbinfo.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl index 945cbad00f..080a5e91aa 100755 --- a/tools/nut-usbinfo.pl +++ b/tools/nut-usbinfo.pl @@ -361,7 +361,8 @@ sub find_usbdevs $driver=$1; } else { - die "Unknown driver type: $nameFile"; + warn "Unknown driver type: $nameFile"; + next; } if ($vendor{$VendorID}{$ProductID}{"driver"}) { if ($driver ne $vendor{$VendorID}{$ProductID}{"driver"}) { From 230bcba0c7668839d609be3e2f867afa0203b4a6 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 27 Jan 2024 20:24:56 +0100 Subject: [PATCH 4/5] drivers/*-mib.c: convert versions to at least double digits Signed-off-by: Jim Klimov --- drivers/apc-ats-mib.c | 2 +- drivers/apc-epdu-mib.c | 2 +- drivers/apc-pdu-mib.c | 2 +- drivers/bestpower-mib.c | 2 +- drivers/delta_ups-mib.c | 2 +- drivers/eaton-pdu-nlogic-mib.c | 2 +- drivers/eaton-pdu-pulizzi-mib.c | 2 +- drivers/emerson-avocent-pdu-mib.c | 2 +- drivers/hpe-pdu3-cis-mib.c | 2 +- drivers/huawei-mib.c | 2 +- drivers/raritan-pdu-mib.c | 2 +- drivers/raritan-px2-mib.c | 2 +- drivers/xppc-mib.c | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/apc-ats-mib.c b/drivers/apc-ats-mib.c index 5cb8cc50be..227c5ff6cd 100644 --- a/drivers/apc-ats-mib.c +++ b/drivers/apc-ats-mib.c @@ -24,7 +24,7 @@ #include "apc-ats-mib.h" -#define APC_ATS_MIB_VERSION "0.6" +#define APC_ATS_MIB_VERSION "0.60" #define APC_ATS_SYSOID ".1.3.6.1.4.1.318.1.3.11" #define APC_ATS_OID_MODEL_NAME ".1.3.6.1.4.1.318.1.1.8.1.5.0" diff --git a/drivers/apc-epdu-mib.c b/drivers/apc-epdu-mib.c index bc8b288b11..7386f3a07d 100644 --- a/drivers/apc-epdu-mib.c +++ b/drivers/apc-epdu-mib.c @@ -23,7 +23,7 @@ #include "apc-epdu-mib.h" -#define APC_EPDU_MIB_VERSION "0.1" +#define APC_EPDU_MIB_VERSION "0.10" #define APC_EPDU_MIB_SYSOID ".1.3.6.1.4.1.318.1.3.4.9" diff --git a/drivers/apc-pdu-mib.c b/drivers/apc-pdu-mib.c index 2ca28df12c..a4b882153f 100644 --- a/drivers/apc-pdu-mib.c +++ b/drivers/apc-pdu-mib.c @@ -23,7 +23,7 @@ #include "apc-pdu-mib.h" -#define APC_PDU_MIB_VERSION "0.4" +#define APC_PDU_MIB_VERSION "0.40" #define APC_PDU_MIB_SYSOID_RPDU ".1.3.6.1.4.1.318.1.3.4.4" #define APC_PDU_MIB_SYSOID_RPDU2 ".1.3.6.1.4.1.318.1.3.4.5" diff --git a/drivers/bestpower-mib.c b/drivers/bestpower-mib.c index 51ba1a62c3..13b86d52b8 100644 --- a/drivers/bestpower-mib.c +++ b/drivers/bestpower-mib.c @@ -22,7 +22,7 @@ #include "bestpower-mib.h" -#define BESTPOWER_MIB_VERSION "0.4" +#define BESTPOWER_MIB_VERSION "0.40" #define BESTPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.2947.1.1.2.0" /* diff --git a/drivers/delta_ups-mib.c b/drivers/delta_ups-mib.c index 888542aef8..d5052083e6 100644 --- a/drivers/delta_ups-mib.c +++ b/drivers/delta_ups-mib.c @@ -25,7 +25,7 @@ #include "delta_ups-mib.h" -#define DELTA_UPS_MIB_VERSION "0.5" +#define DELTA_UPS_MIB_VERSION "0.50" #define DELTA_UPS_SYSOID ".1.3.6.1.4.1.2254.2.4" diff --git a/drivers/eaton-pdu-nlogic-mib.c b/drivers/eaton-pdu-nlogic-mib.c index 5a97fadd26..fe1cad6846 100644 --- a/drivers/eaton-pdu-nlogic-mib.c +++ b/drivers/eaton-pdu-nlogic-mib.c @@ -24,7 +24,7 @@ #include "eaton-pdu-nlogic-mib.h" -#define EATON_PDU_NLOGIC_MIB_VERSION "0.1" +#define EATON_PDU_NLOGIC_MIB_VERSION "0.10" #define EATON_PDU_NLOGIC_SYSOID ".1.3.6.1.4.1.534.7.1" diff --git a/drivers/eaton-pdu-pulizzi-mib.c b/drivers/eaton-pdu-pulizzi-mib.c index 54b81433b3..7ed0f3f1a5 100644 --- a/drivers/eaton-pdu-pulizzi-mib.c +++ b/drivers/eaton-pdu-pulizzi-mib.c @@ -42,7 +42,7 @@ /* Pulizzi Switched ePDU */ -#define EATON_PULIZZI_SW_MIB_VERSION "0.5" +#define EATON_PULIZZI_SW_MIB_VERSION "0.50" #define PULIZZI_SW_OID_MIB ".1.3.6.1.4.1.20677.3.1.1" #define PULIZZI_SW_OID_MODEL_NAME ".1.3.6.1.4.1.20677.2.1.1.0" diff --git a/drivers/emerson-avocent-pdu-mib.c b/drivers/emerson-avocent-pdu-mib.c index 8ca90d8a3c..0154e44cd1 100644 --- a/drivers/emerson-avocent-pdu-mib.c +++ b/drivers/emerson-avocent-pdu-mib.c @@ -25,7 +25,7 @@ #include "emerson-avocent-pdu-mib.h" -#define EMERSON_AVOCENT_MIB_VERSION "1.3" +#define EMERSON_AVOCENT_MIB_VERSION "1.30" #define EMERSON_AVOCENT_SYSOID ".1.3.6.1.4.1.10418.17.1.7" #define EMERSON_AVOCENT_OID_MODEL_NAME ".1.3.6.1.4.1.10418.17.2.1.2.0" diff --git a/drivers/hpe-pdu3-cis-mib.c b/drivers/hpe-pdu3-cis-mib.c index 5b6bf9ef86..392f745ac6 100644 --- a/drivers/hpe-pdu3-cis-mib.c +++ b/drivers/hpe-pdu3-cis-mib.c @@ -21,7 +21,7 @@ #include "hpe-pdu3-cis-mib.h" -#define HPE_PDU3_CIS_MIB_VERSION "0.1" +#define HPE_PDU3_CIS_MIB_VERSION "0.10" #define HPE_PDU3_CIS_SYSOID ".1.3.6.1.4.1.232.165.11" #define HPE_PDU3_OID_MODEL_NAME ".1.3.6.1.4.1.232.165.11.1.2.1.3.1" diff --git a/drivers/huawei-mib.c b/drivers/huawei-mib.c index 42b90e5845..949c0215df 100644 --- a/drivers/huawei-mib.c +++ b/drivers/huawei-mib.c @@ -21,7 +21,7 @@ #include "huawei-mib.h" -#define HUAWEI_MIB_VERSION "0.4" +#define HUAWEI_MIB_VERSION "0.40" #define HUAWEI_SYSOID ".1.3.6.1.4.1.8072.3.2.10" #define HUAWEI_UPSMIB ".1.3.6.1.4.1.2011" diff --git a/drivers/raritan-pdu-mib.c b/drivers/raritan-pdu-mib.c index f4e52ac440..2dd5dfd9f2 100644 --- a/drivers/raritan-pdu-mib.c +++ b/drivers/raritan-pdu-mib.c @@ -25,7 +25,7 @@ #include "raritan-pdu-mib.h" -#define RARITAN_MIB_VERSION "0.8" +#define RARITAN_MIB_VERSION "0.80" /* Raritan MIB * this one uses the same MIB as Eaton Revelation, diff --git a/drivers/raritan-px2-mib.c b/drivers/raritan-px2-mib.c index 627105162e..022a9c9f24 100644 --- a/drivers/raritan-px2-mib.c +++ b/drivers/raritan-px2-mib.c @@ -23,7 +23,7 @@ #include "raritan-px2-mib.h" -#define RARITAN_PX2_MIB_VERSION "0.4" +#define RARITAN_PX2_MIB_VERSION "0.40" #define RARITAN_PX2_MIB_SYSOID ".1.3.6.1.4.1.13742.6" #define RARITAN_PX2_OID_MODEL_NAME ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1" diff --git a/drivers/xppc-mib.c b/drivers/xppc-mib.c index cfbc450b89..596f110f19 100644 --- a/drivers/xppc-mib.c +++ b/drivers/xppc-mib.c @@ -24,7 +24,7 @@ #include "xppc-mib.h" -#define XPPC_MIB_VERSION "0.4" +#define XPPC_MIB_VERSION "0.40" #define XPPC_SYSOID ".1.3.6.1.4.1.935" From d1706425c8e10bc13236c96bccdd676d7f671eb5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 24 Jan 2024 01:03:39 +0100 Subject: [PATCH 5/5] scripts/subdriver/gen-snmp-subdriver.sh: start subdriver versions as 0.01 for double digits Signed-off-by: Jim Klimov --- scripts/subdriver/gen-snmp-subdriver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/subdriver/gen-snmp-subdriver.sh b/scripts/subdriver/gen-snmp-subdriver.sh index 4683aff9a5..aa9a53fd5c 100755 --- a/scripts/subdriver/gen-snmp-subdriver.sh +++ b/scripts/subdriver/gen-snmp-subdriver.sh @@ -10,7 +10,7 @@ # Copyright (C) # 2011 - 2012 Arnaud Quette # 2015 - 2022 Eaton (author: Arnaud Quette ) -# 2011 - 2022 Jim Klimov +# 2011 - 2024 Jim Klimov # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -206,7 +206,7 @@ generate_C() { #include "${HFILE}" - #define ${UDRIVER}_MIB_VERSION "0.1" + #define ${UDRIVER}_MIB_VERSION "0.01" #define ${UDRIVER}_SYSOID "${DEVICE_SYSOID}"