diff options
author | EuAndreh <eu@euandre.org> | 2021-06-23 20:44:40 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-23 21:01:24 -0300 |
commit | 412a3f36cb40dba18f4f0f70a6804882ac6c68eb (patch) | |
tree | 13555d96414c0f8289bc55582ebe16a4217af967 /.gitignore | |
parent | git mv doc/*.po po/ (diff) | |
download | git-permalink-412a3f36cb40dba18f4f0f70a6804882ac6c68eb.tar.gz git-permalink-412a3f36cb40dba18f4f0f70a6804882ac6c68eb.tar.xz |
aux/workflow/manpages.sh: Refactor how manpages and translations are made
I didn't like the previous version of aux/workflow/manpages.sh mainly for 2 reasons:
1. its CLI was terrible, ugly and fragile;
2. it mixed handling manpages and handling *translations*.
The first step was to split the translations part to a different file:
aux/workflow/l10n.sh. Now it has the base logic for running po4a, and
can apply it to manpages. It is useful for updating translated files
in other scenarios, such as catgets() message catalogs, markdown files,
etc.
After I used the venerable getopts to handle the command line
arguments, and give aux/workflow/manpages.sh a saner interface.
I disliked the fact that aux/workflow/manpages.sh still is being used
for the "install" and "uninstall" targets. Before this file, the
canonical workflow of "make && make install/uninstall" was 100%
embedded within the Makefile itself. But now the Makefile calls to an
external script for that. This isn't a real cost, other than how
obvious the behaviour is for someone looking at the Makefile for the
first time.
I still chose to do it anyway, because there was already too many
things in the Makefile itself, and it was getting worse with time. I
made sure to never cross the line of relying on an external tool for
the canonical "make && make install/uninstall", and even for
"make check". Those all work without requiring any extra tool outside
what POSIX defines, such as "sed", "awk", etc. Despite the cost of
adding this detour from the liner Makefile flow, I found it to be worth
it to call to the external script, as this script can now also be
shared across projects, and the customized Makefile be made simpler.
In other to remove the "-- $(do_subst)" horrendous hack, I chose to use
an inference rule for ".in" files, and remove the "$(do_subst)"
variable altogether. Now all the files that need to go through sed
should end in ".in", and the Makefile will take care of producing it.
The upside is that this model is much better integrater into make
itself.
Addresses #task-9ee2bbc8-295f-52b7-4104-483869bad017.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,6 +1,7 @@ /public/ -/git-permalink +/src/git-permalink.sh /po/*.mo /po/*.po~ /tests/remotes/ /tests/prefix/ +/doc/*.1 |