build-aux: rewrite po file minimizer in Python

As part of an goal to eliminate Perl from libvirt build tools,
rewrite the minimize-po.pl tool in Python.

This was a straight conversion, manually going line-by-line to
change the syntax from Perl to Python. Thus the overall structure
of the file and approach is the same.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-08-30 13:22:54 +01:00
parent 17bbdef5cb
commit b2c2a3ae91
4 changed files with 58 additions and 39 deletions

View File

@@ -58,7 +58,7 @@ update-mini-po: $(POTFILE)
$(MSGMERGE) --no-location --no-fuzzy-matching --sort-output \
$$lang.po $(POTFILE) | \
$(SED) $(SED_PO_FIXUP_ARGS) | \
$(PERL) $(top_srcdir)/build-aux/minimize-po.pl > \
$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/minimize-po.py > \
$(srcdir)/$$lang.mini.po ; \
done