Skip to content

Commit c4cc582

Browse files
committed
Merge branch 'PhoenixContactModbus-add-new-models' of https://github.com/RikyPlaza/nut into PhoenixContactModbus-add-new-models
2 parents 8d1468f + 7d5f7d6 commit c4cc582

28 files changed

+1573
-284
lines changed

Jenkinsfile-dynamatrix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ import org.nut.dynamatrix.*;
255255

256256
// Imported from jenkins-dynamatrix JSL vars/autotools.groovy:
257257
// a workaround for the cases of curiously missing MAKE envvar...
258-
dynacfgPipeline.buildPhases['distcheck'] = """( if [ x"\${MAKE-}" = x ]; then echo "WARNING: MAKE is somehow unset, defaulting!" >&2; MAKE=make; fi; eval \${CONFIG_ENVVARS} time \${MAKE} \${MAKE_OPTS} distcheck DISTCHECK_FLAGS=\${CONFIG_OPTS:+\\"\$CONFIG_OPTS\\"} )"""
258+
// Note that NUT Makefile has a concept of "distcheck-ci" to
259+
// cater for documentation files (pre-generated man pages) that
260+
// must be present in the dist tarball, but may not be available
261+
// or creatable on the build agent - in that case we fake them.
262+
dynacfgPipeline.buildPhases['distcheck'] = """( if [ x"\${MAKE-}" = x ]; then echo "WARNING: MAKE is somehow unset, defaulting!" >&2; MAKE=make; fi; eval \${CONFIG_ENVVARS} time \${MAKE} \${MAKE_OPTS} distcheck-ci DISTCHECK_FLAGS=\${CONFIG_OPTS:+\\"\$CONFIG_OPTS\\"} )"""
259263

260264
// Note: shellcheck/spellcheck/... require autotools currently
261265
// or need to be redefined with respective BUILD_TYPE

Makefile.am

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ACLOCAL_AMFLAGS = -I m4
4040
# (alas sequential) target recipes. The order matters, as several subdirectories
4141
# depend on stuff in "common" or tools being built first!
4242
SUBDIRS = include common clients conf data drivers tools \
43-
lib scripts server tests docs
43+
lib scripts server tests docs/man docs
4444

4545
# Note: not generated from SUBDIRS, because not all are recursive:
4646
SUBDIRS_ALL_RECURSIVE = \
@@ -420,24 +420,100 @@ DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \
420420
# DISTCHECK_CONFIGURE_FLAGS defaults defined above in a manner
421421
# that is meaningful for sub-make program (gets stripped away
422422
# otherwise and breaks custom distchecks).
423-
distcheck-light:
423+
424+
# Helper for CI runs: ensure presence of pre-built man pages
425+
# (even if faked where lack and can not build them), so that
426+
# the majority of distcheck logic can pass.
427+
# See also docs/man/Makefile.am
428+
if KNOWN_UNABLE_MANS
429+
if DOC_INSTALL_DISTED_MANS
430+
distcheck-ci: distcheck
431+
dist-ci: dist
432+
else !DOC_INSTALL_DISTED_MANS
433+
distcheck-ci: distcheck-fake-man
434+
dist-ci: dist-fake-man
435+
endif !DOC_INSTALL_DISTED_MANS
436+
else !KNOWN_UNABLE_MANS
437+
if WITH_MANS
438+
distcheck-ci: distcheck
439+
dist-ci: dist
440+
else !WITH_MANS
441+
if HAVE_ASCIIDOC
442+
distcheck-ci: distcheck
443+
dist-ci: dist
444+
else !HAVE_ASCIIDOC
445+
if DOC_INSTALL_DISTED_MANS
446+
distcheck-ci: distcheck
447+
dist-ci: dist
448+
else !DOC_INSTALL_DISTED_MANS
449+
distcheck-ci: distcheck-fake-man
450+
dist-ci: dist-fake-man
451+
endif !DOC_INSTALL_DISTED_MANS
452+
endif !HAVE_ASCIIDOC
453+
endif !WITH_MANS
454+
endif !KNOWN_UNABLE_MANS
455+
456+
# Helper for a number of recipes below that explicitly agree to not require
457+
# always real man pages (but require them to dist => distcheck-something)
458+
# for CI or developer iterations on environments with incomplete tool kits:
459+
distcheck-light-DIST_ALL_PAGES:
460+
@echo "Starting $@" >&2
461+
+@cd "$(abs_builddir)/docs/man" && $(MAKE) $(AM_MAKEFLAGS) all
462+
+@cd "$(abs_builddir)/docs/man" && $(MAKE) $(AM_MAKEFLAGS) distcheck-light-DIST_ALL_PAGES
463+
@echo "Completed $@: preparation of pre-built man pages for dist tarball, possibly faked" >&2
464+
465+
# Here we generate man pages (if absent) or fake them
466+
# Require other dependencies as usual distcheck does;
467+
# be sure to pass through caller's DISTCHECK_FLAGS (if any)
468+
distcheck-fake-man: distcheck-light-DIST_ALL_PAGES
469+
@echo "Starting $@" >&2
470+
+prefix='$${prefix}'; if test x"$(DISTCHECK_FLAGS)" = x ; then \
471+
$(MAKE) $(AM_MAKEFLAGS) distcheck ; \
472+
else \
473+
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_FLAGS)" distcheck ; \
474+
fi
475+
@echo "Completed $@: strict distcheck, but with possibly faked pre-built man pages" >&2
476+
477+
dist-fake-man: distcheck-light-DIST_ALL_PAGES
478+
@echo "Starting $@" >&2
479+
+prefix='$${prefix}'; $(MAKE) $(AM_MAKEFLAGS) dist
480+
@echo "Completed $@: strict dist, but with possibly faked pre-built man pages" >&2
481+
482+
# Here we allow to skip docs if tools are absent, so "make dist"
483+
# should not hiccup on lack of the page files (but MAY make them
484+
# if it can); be relaxed toward other dependencies.
485+
distcheck-light: distcheck-light-DIST_ALL_PAGES
486+
@echo "Starting $@" >&2
424487
+prefix='$${prefix}'; $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck
488+
@echo "Completed $@: relaxed distcheck, with possibly faked pre-built man pages" >&2
425489

490+
# Require man pages to be built (or fail trying), but not other docs;
491+
# be relaxed toward other dependencies.
426492
distcheck-light-man:
493+
@echo "Starting $@" >&2
427494
+prefix='$${prefix}'; $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_MAN_FLAGS)" distcheck
495+
@echo "Completed $@: relaxed distcheck, with real man pages" >&2
428496

429497
if HAVE_VALGRIND
430498
# Make the check in current build, if possible
431499
memcheck:
500+
@echo "Starting $@" >&2
432501
@echo "See also scripts/valgrind in NUT sources for a helper tool"
433502
+@cd $(builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) -s $@
434503

435504
# Make a distcheck (and check in particular) with enabled valgrind and debug info
505+
# Here we skip docs so "make dist" should not hiccup on lack of the page files
506+
# (nor try to make them); not using simple distcheck-light-DIST_ALL_PAGES step
507+
# due to custom logic!
436508
distcheck-valgrind:
509+
@echo "Starting $@" >&2
437510
@echo "See also scripts/valgrind in NUT sources for a helper tool"
511+
+@cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) FAKE_PAGES_BUMP_SRC=false distcheck-light-DIST_ALL_PAGES
438512
+prefix='$${prefix}'; $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck
513+
@echo "Completed $@: relaxed distcheck, without man pages ('pre-built' placeholders in dist archive), running tests under valgrind" >&2
439514
else !HAVE_VALGRIND
440515
memcheck distcheck-valgrind:
516+
@echo "Starting $@" >&2
441517
@echo "See also scripts/valgrind in NUT sources for a helper tool"
442518
@echo "SKIPPED $@ : valgrind was not detected on this system by configure script" >&2
443519
endif !HAVE_VALGRIND

NEWS.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ https://github.com/networkupstools/nut/milestone/11
9090
them. [#1245]
9191
9292
- SEMVER, know thyself!
93-
* development iterations of NUT should now identify with not only the
93+
* Development iterations of NUT should now identify with not only the
9494
semantic version of a preceding release, but with git-derived information
9595
about the amount of iterations that followed (if available):
9696
the three-number "semver" would be seen on release snapshots, while
@@ -104,6 +104,7 @@ https://github.com/networkupstools/nut/milestone/11
104104
upgrades via development snapshots, eventually. A copy of the current
105105
version information would be embedded into "dist" archives as a
106106
`VERSION_DEFAULT` file, among provisions for packager tuning. [#1949]
107+
* Documentation about this would be maintained in `docs/nut-versioning.adoc`
107108
* SMF manifests and systemd units now refer to man pages and their online
108109
variants under `NUT_WEBSITE_BASE` dependent on codebase maturity
109110
(development or release snapshot); many programs now display such
@@ -137,6 +138,25 @@ Overall, NUT CI farm build times got 25%+ shorter (which is important as
137138
and we suppose this is an interesting case for other projects to draw
138139
inspiration from for their recipe refactoring. [PR #2825]
139140
141+
- The `make dist` goal now takes more care to require availability of the man
142+
pages to put into the prepared distribution archive. These may come either
143+
from the current build, or inherited from its sources (if using a tarball
144+
initially) on a platform without tooling required for man page generation.
145+
+
146+
This requirement compromises usability of `make distcheck` on platforms without
147+
such tools from sources without pre-built man pages (e.g. builds from git),
148+
so a couple of new goals were introduced in PR #2842:
149+
- `make distcheck-fake-man` generates placeholder files named like pre-built
150+
man pages for any missing files, just for the purpose of constructing
151+
a sane-looking dist archive to `distcheck` strictly otherwise;
152+
- `make distcheck-ci` is routed to `distcheck` or `distcheck-fake-man`
153+
based on build circumstances (ability to build man pages or presence
154+
of pre-built pages, or lack of either);
155+
- Similarly, `make dist-ci` is routed to provide a strict or faked tarball;
156+
- Earlier defined goals like `distcheck-light` or `distcheck-valgrind` now
157+
take advantage of these mechanisms to also produce usable dist archives
158+
for their relaxed or purpose-specific tests.
159+
140160
- the `upsnotify()` common code introduced in recent NUT releases (integrating
141161
with service management frameworks, etc.) was a bit cryptic when it reported
142162
a *failure to notify* (e.g. when not running as a service currently), fixed

README.adoc

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,47 @@ revisions to make it more accessible to newcomers, as well as hardware vendor
242242
cooperation with first-hand driver and protocol submissions, and just about
243243
anything else you can think of.
244244

245+
NUT Support Policy
246+
~~~~~~~~~~~~~~~~~~
247+
248+
The Network UPS Tools project is a community-made open-source effort, primarily
249+
made and maintained by people donating their spare time.
250+
251+
The support channels are likewise open, with preferred ones being
252+
link:https://github.com/networkupstools/nut/issues[the NUT project issue
253+
tracker on GitHub] and the NUT Users mailing list, as detailed at
254+
https://networkupstools.org/support.html page.
255+
256+
Please keep in mind that any help is provided by community members just like
257+
yourself, as a best effort, and subject to their availability and experience.
258+
It is expected that you have read the Frequently Asked Questions, looked at
259+
the link:https://github.com/networkupstools/nut/wiki[NUT wiki], and have a
260+
good grasp about the three-layer design and programs involved in a running
261+
deployment of NUT, for a discussion to be constructive and efficient.
262+
263+
Be patient, polite, and prepare to learn and provide information about your
264+
NUT deployment (version, configuration, OS...) and the device, to collect
265+
logs, and to answer any follow-up questions about your situation.
266+
267+
Finally, note that NUT is packaged and delivered by packaging into numerous
268+
operating systems, appliances and monitoring projects, and may be bundled
269+
with third-party GUI clients. It may be wise of end-users to identify such
270+
cases and ask for help on the most-relevant forum (or several, including the
271+
NUT support channels). It is important to highlight that the NUT project
272+
releases have for a long time been essentially snapshots of better-tested
273+
code, and we do not normally issue patches to "hot-fix" any older releases.
274+
275+
Any improvements of NUT itself are made in the current code base, same as
276+
any other feature development, so to receive desired fixes on your system
277+
(and/or to check that they do solve your particular issue), expect to be
278+
asked to build the recent development iteration from GitHub or work with
279+
your appliance vendor to get a software upgrade.
280+
281+
Over time, downstream OS packaging or other integrations which use NUT, may
282+
issue patches as new package revisions, or new baseline versions of NUT,
283+
according to *their* release policies. It is not uncommon for distributions,
284+
especially "stable" flavours, to be a few years behind upstream projects.
285+
245286

246287
Installing
247288
----------
@@ -724,15 +765,18 @@ configuration file. It is not active by default.
724765
Version Numbering
725766
-----------------
726767
727-
The version numbers work like this: if the middle number is odd, it's a
728-
development tree, otherwise it is the stable tree.
768+
The version numbers historically worked like this: if the middle number
769+
is odd, it's a development tree, otherwise it is the stable tree.
729770
730771
The past stable trees were 1.0, 1.2, 1.4, 2.0, 2.2 and 2.4, with the
731772
latest such stable tree designated 2.6. The development trees were 1.1,
732773
1.3, 1.5, 2.1 and 2.3. Since the 2.4 release, there is no real separate
733774
development branch anymore since the code is available through a revision
734-
control system (namely, Git -- or actually Subversion back then) and its
735-
snapshots become published releases.
775+
control system (namely, Git -- or actually Subversion back then), development
776+
happens in feature branches that are eventually merged into the main trunk,
777+
and its snapshots become published releases. As a result, subsequent versions
778+
(2.7 and 2.8) were released without regard for even/odd values of the minor
779+
version component.
736780
737781
Since 2.7 line of releases, sources are tracked in Git revision control
738782
system, with the project ecosystem being hosted on GitHub, and any code
@@ -751,6 +795,17 @@ This allows for a reasonably growing version of stable baseline and
751795
local development, so that experimental packages can be installed as
752796
upgrades (or well-exposed downgrades).
753797
798+
While the NUT releases retain the semantic versioning three-component
799+
standard, interim builds (trunk snapshots and development branches)
800+
can expose a much more complex structure with the amount of commits
801+
in the trunk since last release, and amount of commits on the branch
802+
unique to it (not in the trunk). Additional data may include overall
803+
amount of commits in the current build since last release, and the
804+
git commit has identifier of the built code base.
805+
806+
More details can be seen in `docs/nut-versioning.adoc` file in the
807+
NUT source code base.
808+
754809
Backwards and Forwards Compatibility
755810
------------------------------------
756811

UPGRADING.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Changes from 2.8.2 to 2.8.3
4242
if this is required, a (NUT_)VERSION_FORCED_SEMVER envvar or file can
4343
help identify the actual NUT release version triplet used on the box.
4444
Please use it, it immensely helps with community troubleshooting!
45+
Documentation about this would be maintained in `docs/nut-versioning.adoc`
4546
[issue #1949]
4647
4748
- When packaging or custom-building for (Linux) distributions with systemd,
@@ -57,6 +58,12 @@ Changes from 2.8.2 to 2.8.3
5758
depending on `target_cpu` of the build. If you had any scripts relying
5859
on the older pattern, they may have to be updated.
5960
61+
- The `make dist` goal now takes more care to require availability of the
62+
man pages to put into the prepared distribution archive. Development and CI
63+
builds on platforms unable to fulfill this goal can use `make distcheck-ci`
64+
(and `make dist-ci`) to fake presence of pre-built man pages with placeholder
65+
files, to complete other aspects of `distcheck` validation. [#2842]
66+
6067
- the PyPI distribution of the `PyNUTClient` module tarball should now use a
6168
lower-cased file name (and immediate versioned directory name inside) to
6269
match the requirements of link:https://peps.python.org/pep-0625/[PEP-0625].

0 commit comments

Comments
 (0)