]> granicus.if.org Git - pgbouncer/commitdiff
Substitute version into man pages automatically
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 2 Aug 2019 06:36:02 +0000 (08:36 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 2 Aug 2019 07:41:54 +0000 (09:41 +0200)
doc/Makefile
doc/filter.py
doc/frag-config-man.md
doc/frag-usage-man.md

index 1ee6f22662698e3495335b63e7feeb41d34f0818..1609af4a96e89a9483ce86c9862861f08d0166fe 100644 (file)
@@ -19,6 +19,8 @@ include $(abs_top_srcdir)/lib/mk/antimake.mk
 
 PYTHON = python
 
+export PACKAGE_VERSION
+
 pgbouncer.%: pgbouncer_%.md
        $(PANDOC) -s -t man -o $@ $<
 
index 04ea1ed9dd0670a0e93772ca0b95fb9add5cba93..e4aaaebe86d16b16d8a8a2dfb905ec1c1966ebaa 100644 (file)
@@ -1,9 +1,13 @@
 #!/usr/bin/env python
 
 import fileinput
+import os
 import sys
 
 for line in fileinput.input():
+    # substitute package version
+    if line.startswith('% '):
+        line = line.replace('@PACKAGE_VERSION@', os.environ['PACKAGE_VERSION'])
     # drop level-1 header
     if line.startswith('# '):
         continue
index 75fd2a5fa49f646570c5c33a1bb012d9eb549620..688e02fa104cb226c24b76f7c637d4d8ca7a8b6b 100644 (file)
@@ -1,4 +1,4 @@
-% PGBOUNCER.INI(5) 1.10.0 | Databases
+% PGBOUNCER.INI(5) @PACKAGE_VERSION@ | Databases
 
 ## Name
 
index 420eb6ef548909dcfdcd6c2584403fb29b8b8479..59ed2a639a82c1a0351da12727cf01b31dce1210 100644 (file)
@@ -1,4 +1,4 @@
-% PGBOUNCER(1) 1.10.0 | Databases
+% PGBOUNCER(1) @PACKAGE_VERSION@ | Databases
 
 ## Name