From accfd812df98719cf8c9485830e55f6224f9a1c8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 22 Mar 2024 16:33:39 +0100 Subject: [PATCH 1/8] Makefile.am: clarify default "all" target variants Signed-off-by: Jim Klimov --- Makefile.am | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0453994435..9484e120ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,11 +9,13 @@ @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export CCACHE_PATH=@CCACHE_PATH@ @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export PATH=@PATH_DURING_CONFIGURE@ -# First target defines default behavior: all +# First target often defines default behavior: all # We follow up with another pass to `make doc` because our wild recipes # sometimes preclude generating all of them on the first pass (FIXME!) -# missing e.g. PDF and HTML which then pop up in `make check` footprint. -all: all-recursive +# missing e.g. PDF and HTML which then pop up in `make check` footprint, +# or misses a .prep-src-docs stage needed to pattern-make man page files +# with some "make" implementations... +all all-am-local all-local: doc all-recursive +@$(MAKE) $(AM_MAKEFLAGS) doc # include directory for aclocal From c86cded4db4ca77564764086305c764bb1693843 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 22 Mar 2024 16:34:12 +0100 Subject: [PATCH 2/8] Makefile.am: fix typo for "docs/man" prep for spellcheck target Signed-off-by: Jim Klimov --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 9484e120ce..b99db53a16 100644 --- a/Makefile.am +++ b/Makefile.am @@ -150,7 +150,7 @@ distclean-local: spellcheck spellcheck-interactive: +@RES=0; \ (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ - (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ + (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs) || RES=$$? ; \ (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ (cd $(builddir)/conf && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ From c64adb30533e14a52cda8b5c26bcaabbc815d8ff Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 22 Mar 2024 16:34:46 +0100 Subject: [PATCH 3/8] Makefile.am: be sure to prep before the many docs-related targets Signed-off-by: Jim Klimov --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index b99db53a16..9e66b28179 100644 --- a/Makefile.am +++ b/Makefile.am @@ -177,6 +177,8 @@ spellcheck spellcheck-interactive: doc spellcheck-sortdict \ all-docs check-docs \ man all-man man-man check-man man-html all-html: + +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs + +cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@ INSTALL.nut UPGRADING NEWS README: From 7de34edc4037d758d9c6937e68030914839517a4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 22 Mar 2024 16:35:24 +0100 Subject: [PATCH 4/8] docs/Makefile.am, docs/man/Makefile.am: clarify default "all" target variants as requiring a prep Signed-off-by: Jim Klimov --- docs/Makefile.am | 1 + docs/man/Makefile.am | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/Makefile.am b/docs/Makefile.am index a49ec8ff57..3442b58833 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -131,6 +131,7 @@ endif WITH_SPELLCHECK check-local: $(CHECK_LOCAL_TARGETS) # Make sure sources are there for out-of-tree builds: +all-local all-am-local \ @DOC_BUILD_LIST@ $(ASCIIDOC_PDF) $(ASCIIDOC_HTML_SINGLE) $(ASCIIDOC_HTML_CHUNKED): $(abs_top_builddir)/docs/.prep-src-docs # This list is defined by configure script choices and options: diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am index dbd3aff360..49db9b036e 100644 --- a/docs/man/Makefile.am +++ b/docs/man/Makefile.am @@ -22,6 +22,8 @@ EGREP = grep -E all: +all-am-local all-local: $(abs_top_builddir)/docs/man/.prep-src-docs + # Base configuration and client manpages, always installed SRC_CONF_PAGES = \ nut.conf.txt \ From 535e0f671269d9e970f53456856911284ba14f78 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 22 Mar 2024 21:01:20 +0100 Subject: [PATCH 5/8] Makefile.am, docs/Makefile.am: use abs_top_builddir for wrapper rules Signed-off-by: Jim Klimov --- Makefile.am | 8 ++++---- docs/Makefile.am | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9e66b28179..08de3eb46a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -177,12 +177,12 @@ spellcheck spellcheck-interactive: doc spellcheck-sortdict \ all-docs check-docs \ man all-man man-man check-man man-html all-html: - +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs - +cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs - +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@ + +cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs + +cd $(abs_top_builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs + +cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@ INSTALL.nut UPGRADING NEWS README: - +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) + +cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) # Workarounds for https://github.com/github/markup/issues/1095 # require direct definition of our attributes in each source diff --git a/docs/Makefile.am b/docs/Makefile.am index 3442b58833..36f1dbb34d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -186,10 +186,10 @@ check-html-chunked: $(ASCIIDOC_HTML_CHUNKED) # chosen during configure script execution. The "all-man" and "all-html" # rules build everything documented. check-man all-man man-man all-html html-man: - +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@ + +cd $(abs_top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@ man: - +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all + +cd $(abs_top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all CLEANFILES = *.xml *.html *.pdf *-spellchecked docbook-xsl.css docinfo.xml.in.tmp CLEANFILES += $(top_builddir)/INSTALL.nut $(top_builddir)/UPGRADING $(top_builddir)/NEWS $(top_builddir)/ChangeLog.adoc $(top_builddir)/README From 0b38251f50ae9e3511e4be274fdb49830985b039 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 23 Mar 2024 18:15:31 +0100 Subject: [PATCH 6/8] tools/gitlog2changelog.py.in: trace absence of "unicode" type in some python bundles Signed-off-by: Jim Klimov --- tools/gitlog2changelog.py.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/gitlog2changelog.py.in b/tools/gitlog2changelog.py.in index 7518f6a5a8..2f4468dbf4 100755 --- a/tools/gitlog2changelog.py.in +++ b/tools/gitlog2changelog.py.in @@ -12,8 +12,15 @@ import subprocess # Python 3 compatibility hack try: + try: + import unicode + except: + # Maybe built-in? + pass unicode('') -except NameError: +except NameError as ex: + #DEBUG# sys.stderr.write("Using 'str' as 'unicode': %s\n" % str(ex)) + #DEBUG# sys.stderr.flush() unicode = str try: From 7dc1020c5321b15b4f62f094f5ab3a5d6f1c638d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 23 Mar 2024 18:16:39 +0100 Subject: [PATCH 7/8] tools/gitlog2changelog.py.in: when authorMustBeASCII, only parse str via unicode() if we did not shortcut it earlier, and fix a typo in encoding value Signed-off-by: Jim Klimov --- tools/gitlog2changelog.py.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gitlog2changelog.py.in b/tools/gitlog2changelog.py.in index 2f4468dbf4..889bf3793e 100755 --- a/tools/gitlog2changelog.py.in +++ b/tools/gitlog2changelog.py.in @@ -132,8 +132,8 @@ for line in fin: author = author[0 : len(author) - fin_chop] if authorMustBeASCII: try: - if isinstance(author, str): - author = unicodedata.normalize(u'NFKD', unicode(author, "UTF=8")).encode('ascii', 'ignore').decode('utf8') + if isinstance(author, str) and unicode != str: + author = unicodedata.normalize(u'NFKD', unicode(author, "utf-8")).encode('ascii', 'ignore').decode('utf8') else: author = unicodedata.normalize(u'NFKD', author).encode('ascii', 'ignore').decode('utf8') except Exception as e: From 69e7faef5efb9b6ed925ad5e0516ac17a3d58fa0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sat, 23 Mar 2024 18:29:12 +0100 Subject: [PATCH 8/8] UPGRADING.adoc, NEWS.adoc: mention changes in tools/gitlog2changelog.py.in [#2360, #2366] Signed-off-by: Jim Klimov --- NEWS.adoc | 6 ++++++ UPGRADING.adoc | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS.adoc b/NEWS.adoc index bb940c62ef..c96914f6b0 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -221,6 +221,12 @@ https://github.com/networkupstools/nut/milestone/10 known deficiencies in Windows platform support, as well as some un-awareness about configuration key words which appeared in NUT since 2013. [#2290] + - The `tools/gitlog2changelog.py.in` script was revised, in particular to + convert section titles (with contributor names coming from Git metadata) + into plain ASCII character set, for `dblatex` versions which do not allow + diacritics and other kinds of non-trivial characters in sections. This can + cause successful builds of `ChangeLog.pdf` file on more platforms, but at + expense of a semi-cosmetic difference in those names. [PR #2360, PR #2366] Release notes for NUT 2.8.1 - what's new since 2.8.0 ---------------------------------------------------- diff --git a/UPGRADING.adoc b/UPGRADING.adoc index cb89c907dd..fbbac8b3df 100644 --- a/UPGRADING.adoc +++ b/UPGRADING.adoc @@ -44,6 +44,13 @@ Changes from 2.8.1 to 2.8.2 appear as comments, or enabled by specifying the `-U` command-line option several times. [#2221] +- The `tools/gitlog2changelog.py.in` script was revised, in particular to + convert section titles (with contributor names) into plain ASCII character + set, for `dblatex` versions which do not allow diacritics and other kinds + of non-trivial characters in sections. A number of other projects seem to + use the NUT version of the script, and are encouraged to look at related + changes in `configure.ac` and `Makefile.am` recipes. [PR #2360, PR #2366] + Changes from 2.8.0 to 2.8.1 ---------------------------