Skip to content

Commit

Permalink
build: Handle po4a --porefs difference between 0.58 and earlier versions
Browse files Browse the repository at this point in the history
Before po4a 0.58 --porefs supported specifying a wrapping mode by
appending «,wrap» or «,nowrap», with the default being “nowrap”.
Starting with po4a 0.58 the default has changed to “wrap”, and these
modifiers are not accepted anymore, which causes a problem with
backwards compatibility as we cannot get consistent behavior across
different versions.

Detect this in configure and pass the «,wrap» modifier when needed
and supported, which should make it possible to build the man pages
again consistently in Debian buster and bullseye.
  • Loading branch information
guillemj committed May 16, 2020
1 parent 6f6f713 commit 2b6a69f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -56,7 +56,7 @@ the source should be roughly equivalent to the distributed tar source.

To enable translated documentation this software will be needed:

po4a >= 0.58
po4a >= 0.43 (>= 0.58 for addenda inclusion)


Building from tar source
Expand Down
3 changes: 2 additions & 1 deletion debian/changelog
Expand Up @@ -67,7 +67,8 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
- Add debian/changelog as a Changes file to the CPAN distribution.
- Set DPKG_SERIES to 1.20.x when running the functional test suite.
- Change po4a --porefs argument from no longer supported “noline,wrap”
to “file”.
to “file,wrap” when the default contains «,nowrap» (po4a < 0.58), and
to “file” otherwise (po4a >= 0.58), to preserve backwards compatibility.
- Switch to set the po4a addendum in the po4a_paths section instead of
repeating it for each man page.
* Packaging:
Expand Down
14 changes: 14 additions & 0 deletions m4/dpkg-progs.m4
Expand Up @@ -38,14 +38,28 @@ AC_DEFUN([DPKG_PROG_PERL], [
# --------------
AC_DEFUN([DPKG_PROG_PO4A], [
AC_REQUIRE([AM_NLS])
AC_REQUIRE([DPKG_PROG_PERL])
AC_ARG_VAR([PO4A], [po4a program])
AC_CHECK_PROGS([PO4A], [po4a])
AS_IF([test "$USE_NLS" = "yes" && test -n "$PO4A"], [
USE_PO4A=yes
po4a_use_wrap=$($PERL -MLocale::Po4a::Po -e \
'my $porefs = Locale::Po4a::Po->new()->{options}{porefs};
print "yes" if $porefs =~ /,nowrap$/')
], [
USE_PO4A=no
])
AC_SUBST([USE_PO4A])
# Starting with po4a 0.58 the --porefs option does not accept the wrap
# modifiers, but earlier versions defaulted to nowrap, so we have to handle
# the backward incompatible change to support older and newer versions.
AS_IF([test "x$po4a_use_wrap" = "xyes"], [
PO4A_POREFS="file,wrap"
], [
PO4A_POREFS="file"
])
AC_SUBST([PO4A_POREFS])
])# DPKG_PROG_PO4A

# DPKG_PROG_POD2MAN
Expand Down
3 changes: 2 additions & 1 deletion man/Makefile.am
Expand Up @@ -147,8 +147,9 @@ PO4A_V = $(PO4A_V_@AM_V@)
PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@)
PO4A_V_0 = @echo " PO4A $@";

PO4A_POREFS = @PO4A_POREFS@
PO4A_OPTS = --previous --srcdir $(srcdir) --destdir $(builddir) --no-backups \
--porefs file --msgmerge-opt=--add-location=file \
--porefs $(PO4A_POREFS) --msgmerge-opt=--add-location=file \
--package-name dpkg-man --package-version $(PACKAGE_VERSION) \
--copyright-holder "$(PACKAGE_COPYRIGHT_HOLDER)" \
--msgid-bugs-address $(PACKAGE_BUGREPORT)
Expand Down

0 comments on commit 2b6a69f

Please sign in to comment.