Update of bug #68908 (group groff):
Status: Confirmed => In Progress
Summary: [troff] .Y register can contain nonnumeric content
when groff built from "dirty" Git working copy => [PATCH] [troff] .Y register
can contain nonnumeric content when groff built from "dirty" Git working copy
_______________________________________________________
Follow-up Comment #12:
diff --git a/src/roff/troff/troff.am b/src/roff/troff/troff.am
index 71da4f0f9..f8e869a22 100644
## 2026-12-01 01:19:50 bash-5.2 [6] {0} (0) branden@illithid:~/src/GIT/groff
!4475$ git dc|cat
diff --git a/ChangeLog b/ChangeLog
index 6a89b6097..bd95148e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2026-12-01 G. Branden Robinson <[email protected]>
+
+ Fix Savannah #68908.
+
+ * Makefile.am: Define new macro, `REVISION_NUM`, which is
+ `REVISION` truncated at the first character that is not a
+ decimal digit.
+ * src/roff/troff/troff.am (src/roff/troff/majorminor.cpp):
+ Interpolate `REVISION_NUM`, not `REVISION` into generated file.
+
+ Fixes <https://savannah.gnu.org/bugs/?68908>. Problem dates
+ back to refactoring of groff build to compute version number
+ from Git information; commit 1264531310, 2018-01-14.
+
2026-11-28 G. Branden Robinson <[email protected]>
[groff]: Regression-test Savannah #68908.
diff --git a/Makefile.am b/Makefile.am
index 49513fa7d..c42240954 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -527,11 +527,15 @@ endif
# REVISION is the full revision given by git-version-gen, which can
# have non-alphanumeric symbols.
#
+# REVISION_NUM is 'REVISION' truncated at the first non-digit; this is
+# what gets stored in GNU troff's `.Y` register.
+#
# configure.ac expands the related GROFF_MAKE_SHORT_VERSION macro.
MAJOR_VERSION = `echo $(VERSION) | cut -d . -f 1`
MINOR_VERSION = `echo $(VERSION) | cut -d . -f 2`
REVISION = `echo $(VERSION) | cut -d . -f 3`
+REVISION_NUM = `echo $(VERSION) | cut -d . -f 3 | sed 's/[^0-9].*//'`
# Non-recursive makefile system. See Automake manual '7.3 An
# Alternative Approach to Subdirectories'. We use a single Makefile.am
diff --git a/src/roff/troff/troff.am b/src/roff/troff/troff.am
index 71da4f0f9..f8e869a22 100644
--- a/src/roff/troff/troff.am
+++ b/src/roff/troff/troff.am
@@ -55,7 +55,7 @@ src/roff/troff/majorminor.cpp: .version
$(AM_V_at)printf 'const char *minor_version = "%s";\n' \
$(MINOR_VERSION) >> [email protected]
$(AM_V_at)printf 'const char *revision = "%s";\n' \
- $(REVISION) >> [email protected]
+ $(REVISION_NUM) >> [email protected]
$(AM_V_GEN)mv [email protected] $@
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68908>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
