Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
660776b
docs/config-prereqs.txt: update instructions for NetBSD 11.0 (Beta)
jimklimov Feb 4, 2026
afe33f0
configure.ac: refine reporting of GPIO_VERSION when there is none
jimklimov Feb 4, 2026
f436906
scripts/augeas/gen-nutupsconf-aug.py.in, scripts/python/module/setup.…
jimklimov Feb 4, 2026
14d59da
Makefile.am: SET_PARMAKES_OPT snippet should not have started with "+…
jimklimov Feb 4, 2026
77a8125
Makefile.am: package: should not depend on "dist" to package up "all"…
jimklimov Feb 4, 2026
9c2751c
scripts/python/module/Makefile.am: better indent multi-line rules
jimklimov Feb 4, 2026
eb3a409
configure.ac, Makefile.am, NEWS.adoc: mark goals which expand SUBDIR_…
jimklimov Feb 4, 2026
5ca18a2
GitIgnore "tags" files left over by (probably) bmake
jimklimov Feb 4, 2026
704d7b8
configure.ac: rectify handling of nut_with_confdir [#3131]
jimklimov Feb 5, 2026
2f860fe
scripts/Windows/Installer/NUT-Installer.xml.in: ensure a newline at e…
jimklimov Feb 5, 2026
b09e4d9
configure.ac, tools/nut-scanner/nut-scan.h, tools/nut-scanner/Makefil…
jimklimov Feb 5, 2026
571f744
drivers/ydn23.h: fix printing of "%zu" with PRIuSIZE
jimklimov Feb 5, 2026
38021da
configure.ac, include/nut_stdint.h, NEWS.adoc: actually detect suppor…
jimklimov Feb 5, 2026
09e1775
common/common.c: nut_prepare_search_paths(): debug more about progres…
jimklimov Feb 5, 2026
712a971
common/common.c: nut_prepare_search_paths(): separate logging from in…
jimklimov Feb 5, 2026
04edf90
common/common.c: nut_prepare_search_paths(): some systems require non…
jimklimov Feb 5, 2026
26fe2a1
common/common.c: get_libname_in_*(): use NUT_STRARG() when logging st…
jimklimov Feb 5, 2026
e4472a3
common/common.c: vupslog(): be conservative about growing our buffer,…
jimklimov Feb 5, 2026
21bcb05
docs/nut.dict: update the dictionary [#3300]
jimklimov Feb 5, 2026
cd9411a
common/common.c: refine deliberate logging without PRIuSIZE in nut_pr…
jimklimov Feb 5, 2026
2f9638c
tools/nut-scanner/scan_nut_simulation.c: use "#ifdef HAVE_PTHREAD" co…
jimklimov Feb 5, 2026
6442c0c
configure.ac: better detect HAVE_SEMAPHORE_LIBS (even if we do not ne…
jimklimov Feb 5, 2026
182a7c9
configure.ac: avoid reporting "Whether to enable support for parallel…
jimklimov Feb 5, 2026
f2550c4
common/common.c: fix freeing of dynamically detected search_paths aft…
jimklimov Feb 6, 2026
3e7021c
tools/nut-scanner/scan_usb.c: do not call libusb_exit() after a faile…
jimklimov Feb 6, 2026
76b801b
tools/gitlog2version.sh: fix for git describe versions before --exclu…
jimklimov Feb 6, 2026
5804a73
tools/nut-scanner/scan_nut.c: debug-trace what in upscli failed [#3300]
jimklimov Feb 6, 2026
c709708
configure.ac: avoid AM_COND_IF absent in older aclocal builds [#3300]
jimklimov Feb 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/_install_pkgprotodir/
Makefile
Makefile.in
tags

## Parent directory only
/aclocal.m4
Expand Down
144 changes: 72 additions & 72 deletions Makefile.am

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ https://github.com/networkupstools/nut/milestone/12
not normally get into those code paths with the `x*()` methods which
should bail out and abort the program with a common error message when
an allocation fails. [#3293]
* We have long abstracted `(s)size_t` value printing in debug logs etc.
using `PRIuSIZE` and similar macros. They fell back to `"%zu"` when not
provided otherwise, but not all platforms actually deliver these format
characters. Now it is evaluated at `configure` time (to check that the
characters may be used), and if not -- during `nut_stdint.h` parsing to
fit known `int`/`long`/`long long` types. [#3300]

- NUT for Windows specific updates:
* Revised detection of (relative) paths to program and configuration files
Expand Down Expand Up @@ -426,11 +432,22 @@ several `FSD` notifications into one executed action. [PR #3097]
* Fixed `m4/ax_realpath_lib.m4` up with more ways to try and gauge the
build-time library name from linker/compiler, to improve the chances
that `nut-scanner` would find them. [#3293]
* Added an option to (primarily) `--disable-threading` for systems with
detected but broken `libpthread` support, or to test alternate code
paths during development or in CI. [#3300]

- Recipes, CI and helper script updates not classified above:
* Fixed CI recipes for PyPI publication of PyNUT(Client) module to also
include the source distribution (was posted for NUT v2.8.1 and v2.8.2
tagged releases, but absent for v2.8.3 and v2.8.4). [#3056]
* A new version of BSD `make` in NetBSD 11 (Beta) aka `bmake` in some other
operating systems, complains about some of our sub-`$(MAKE)` calls despite
the explicit `+` prefix in corresponding lines, possibly because that call
happens not directly in a rule definition, but in a substituted shell code
snippet. The recommended workaround was to add a "Special Source" called
`.MAKE` to let the tool know that we expect sub-makes in that recipe.
However, *other* `make` implementations do not know about this token,
so its support is tried and detected at `configure` time. [PR #3300]
* Updated `make spellcheck` to help avoid asciidoc admonition blocks with
visually invalid sentences (after rendering as a box in HTML or PDF).
[#3077]
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ Changes from 2.8.4 to 2.8.5
updated, either to explicitly package the binding for several versions,
or to not-deliver files no longer installed into the prototype area. [#1792]
- Added a `configure` script option to (primarily) `--disable-threading`
for systems with detected but broken `libpthread` support, which can
cause `nut-scanner` to crash while loading system libraries. [#3300]
- Introduced a new driver category for interaction with OS-reported UPS
devices via D-Bus, with the `nut-upower` driver as the first implementation.
This driver requires `glib-2.0` and `gio-2.0` development libraries to be
Expand Down
4 changes: 2 additions & 2 deletions clients/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(top_builddir)/common/libcommon.la \
$(top_builddir)/common/libcommonclient.la \
$(top_builddir)/common/libcommonversion.la \
$(top_builddir)/common/libcommonstrjson.la \
$(top_builddir)/common/libparseconf.la: dummy
$(top_builddir)/common/libparseconf.la: dummy @dotMAKE@
+@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)

# Builds from root dir arrange stuff decently. Make sure parallel builds
Expand All @@ -39,7 +39,7 @@ LDADD_CLIENT =
if ENABLE_SHARED_PRIVATE_LIBS
$(top_builddir)/common/libcommonversion-private.la \
$(top_builddir)/common/libnutprivate-@NUT_SOURCE_GITREV_SEMVER_UNDERSCORES@-common-all.la \
$(top_builddir)/common/libnutprivate-@NUT_SOURCE_GITREV_SEMVER_UNDERSCORES@-common-client.la: dummy
$(top_builddir)/common/libnutprivate-@NUT_SOURCE_GITREV_SEMVER_UNDERSCORES@-common-client.la: dummy @dotMAKE@
+@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)

$(top_builddir)/common/libcommonversion-private.la: $(top_builddir)/include/nut_version.h
Expand Down
2 changes: 1 addition & 1 deletion common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ else !BUILDING_IN_TREE
BUILT_SOURCES = common-nut_version.c
endif !BUILDING_IN_TREE

$(top_builddir)/include/nut_version.h:
$(top_builddir)/include/nut_version.h: @dotMAKE@
+@if [ -s '$@' ] && ( [ x"$(NUT_VERSION_H_GENERATED)" = xtrue ] || [ x"$${NUT_VERSION_H_GENERATED}" = xtrue ] ) ; then \
if [ x"$(MAINTAINER_GENERATE_HEADER_DEBUG)" = xyes ] ; then \
echo "=== SKIP (common) $@ (NUT_VERSION_H_GENERATED makevar=$(NUT_VERSION_H_GENERATED) shellvar=$${NUT_VERSION_H_GENERATED})" >&2; \
Expand Down
52 changes: 41 additions & 11 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3767,7 +3767,13 @@ char * mkstr_dynamic(const char *fmt_dynamic, const char *fmt_reference, ...)
static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
{
int ret, errno_orig = errno;
#ifdef HAVE_VA_COPY_VARIANT
size_t bufsize = 128;
#else
/* err on the safe(r) side, as re-runs can truncate
* the output when varargs are re-used */
size_t bufsize = LARGEBUF;
#endif
char *buf = (char *)xcalloc(bufsize, sizeof(char));

/* Be pedantic about our limitations */
Expand Down Expand Up @@ -3827,7 +3833,7 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
* Based on https://stackoverflow.com/a/72981237/4715872
*/
if (bufsize < SIZE_MAX/2) {
size_t newbufsize = bufsize*2;
size_t newbufsize = bufsize < LARGEBUF ? LARGEBUF : bufsize*2;
if (ret > 0) {
/* Be generous, we snprintfcat() some
* suffixes, prefix a timestamp, etc. */
Expand Down Expand Up @@ -4794,10 +4800,14 @@ static void nut_free_search_paths(void) {
}

if (search_paths != search_paths_builtin) {
#if HAVE_DECL_REALPATH
size_t i;
for (i = 0; search_paths[i] != NULL; i++) {
upsdebugx(7, "%s: freeing search_paths[%" PRIuSIZE "]: '%s'",
__func__, i, NUT_STRARG(search_paths[i]));
free((char *)search_paths[i]);
}
#endif /* else: curated selection of pointers to some of the built-in strings */
free(search_paths);
search_paths = search_paths_builtin;
}
Expand All @@ -4819,10 +4829,17 @@ void nut_prepare_search_paths(void) {
size_t count_builtin = 0, count_filtered = 0, i, j, index = 0;
const char ** filtered_search_paths;
DIR *dp;
#if HAVE_DECL_REALPATH
/* Per docs, buffer must be at least PATH_MAX bytes */
char realpath_buf[NUT_PATH_MAX + 1] = {0}, *realpath_dirname = NULL;
#endif

/* As a starting point, allow at least as many items as before */
/* TODO: somehow extend (xrealloc?) if we mix other paths later */
for (i = 0; search_paths_builtin[i] != NULL; i++) {}
for (i = 0; search_paths_builtin[i] != NULL; i++) {
/* Different way of printing with minimal crash-ability on older systems */
upsdebugx(7, "counting search_paths_builtin[%d] : %s", (int)i, NUT_STRARG(search_paths_builtin[i]));
}
count_builtin = i + 1; /* +1 for the NULL */

/* Bytes inside should all be zeroed... */
Expand All @@ -4834,22 +4851,35 @@ void nut_prepare_search_paths(void) {
int dupe = 0;
const char *dirname = search_paths_builtin[i];

upsdebugx(7, "%s: checking search_paths_builtin[%" PRIuSIZE " of %" PRIuSIZE "] : %s",
__func__, i, count_builtin - 1, NUT_STRARG(dirname));
if ((dp = opendir(dirname)) == NULL) {
upsdebugx(5, "%s: SKIP "
"unreachable directory #%" PRIuSIZE " : %s",
__func__, index++, dirname);
__func__, index, NUT_STRARG(dirname));
index++;
continue;
}
index++;

#if HAVE_DECL_REALPATH
/* allocates the buffer we free() later */
dirname = (const char *)realpath(dirname, NULL);
upsdebugx(7, "%s: call realpath()", __func__);
errno = 0;
realpath_dirname = realpath(dirname, realpath_buf);
if (errno || !realpath_dirname)
upsdebug_with_errno(7, "%s: realpath() failed and returned: %s", __func__, NUT_STRARG(realpath_dirname));
else
upsdebugx(7, "%s: realpath() returned: %s", __func__, NUT_STRARG(realpath_dirname));
if (realpath_dirname)
dirname = (const char *)realpath_dirname;
#endif

/* Revise for duplicates */
/* Note: (count_filtered == 0) means first existing dir seen, no hassle */
for (j = 0; j < count_filtered; j++) {
upsdebugx(7, "%s: check for duplicates filtered_search_paths[%" PRIuSIZE " of %" PRIuSIZE "] : %s",
__func__, j, count_filtered, NUT_STRARG(filtered_search_paths[j]));
if (!strcmp(filtered_search_paths[j], dirname)) {
#if HAVE_DECL_REALPATH
if (strcmp(search_paths_builtin[i], dirname)) {
Expand All @@ -4866,7 +4896,6 @@ void nut_prepare_search_paths(void) {

dupe = 1;
#if HAVE_DECL_REALPATH
free((char *)dirname);
/* Have some valid value, for kicks (likely
* to be ignored in the code path below) */
dirname = search_paths_builtin[i];
Expand All @@ -4879,9 +4908,10 @@ void nut_prepare_search_paths(void) {
upsdebugx(5, "%s: ADD[#%" PRIuSIZE "] "
"existing unique directory: %s",
__func__, count_filtered, dirname);
#if !HAVE_DECL_REALPATH
/* Make a copy of table entry, else we have
* a dynamic result of realpath() made above.
#if HAVE_DECL_REALPATH
/* Make a copy of table entry, or the buffer
* with a result of realpath() made above,
* to eventually conststently free().
*/
dirname = (const char *)xstrdup(dirname);
#endif
Expand Down Expand Up @@ -4984,7 +5014,7 @@ static char * get_libname_in_dir(const char* base_libname, size_t base_libname_l
char current_test_path[NUT_PATH_MAX + 1];

upsdebugx(3, "%s('%s', %" PRIuSIZE ", '%s', %i): Entering method...",
__func__, base_libname, base_libname_length, dirname, index);
__func__, NUT_STRARG(base_libname), base_libname_length, NUT_STRARG(dirname), index);

memset(current_test_path, 0, sizeof(current_test_path));

Expand Down Expand Up @@ -5117,7 +5147,7 @@ static char * get_libname_in_pathset(const char* base_libname, size_t base_libna
/* First call to tokenization passes the string, others pass NULL */
pathset_tmp = xstrdup(pathset);
upsdebugx(4, "%s: Looking for lib %s in a colon-separated path set",
__func__, base_libname);
__func__, NUT_STRARG(base_libname));
while (NULL != (onedir = strtok( (onedir ? NULL : pathset_tmp), ":" ))) {
libname_path = get_libname_in_dir(base_libname, base_libname_length, onedir, (*counter)++);
if (libname_path != NULL)
Expand Down Expand Up @@ -5153,7 +5183,7 @@ char * get_libname(const char* base_libname)
size_t base_libname_length = strlen(base_libname);
struct stat st;

upsdebugx(3, "%s('%s'): Entering method...", __func__, base_libname);
upsdebugx(3, "%s('%s'): Entering method...", __func__, NUT_STRARG(base_libname));

/* First, check for an exact hit by absolute/relative path
* if `base_libname` includes path separator character(s) */
Expand Down
8 changes: 4 additions & 4 deletions conf/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ SPELLCHECK_SRC = $(dist_sysconf_DATA) \
# We also have to export some variables that may be tainted by relative
# paths when parsing the other makefile (e.g. MKDIR_P that may be defined
# via expanded $(top_builddir)/install-sh):
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) @dotMAKE@
# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@

# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here
# by a wildcard target in case the make implementation can put the two together.
*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)

.sample.sample-spellchecked:
.sample.sample-spellchecked: @dotMAKE@
+$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@

.in.in-spellchecked:
.in.in-spellchecked: @dotMAKE@
+$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@

spellcheck spellcheck-interactive spellcheck-sortdict:
spellcheck spellcheck-interactive spellcheck-sortdict: @dotMAKE@
+$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@


Expand Down
Loading
Loading