1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

man: enhance man postprocessing regexp

This commit is contained in:
Heinz Mauelshagen 2017-03-28 00:17:43 +02:00
parent 88e408b8ed
commit 7f31261844

View File

@ -173,8 +173,27 @@ define SUBSTVARS
echo "Generating $@" ; $(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+/data/lvmtest/usr/sbin/clvmd+;s+#LVM_PATH#+/data/lvmtest/sbin/lvm+;s+#DEFAULT_RUN_DIR#+/var/run/lvm+;s+#DEFAULT_PID_DIR#+/var/run+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;s+#DEFAULT_MANGLING#+$(DEFAULT_MANGLING)+;" $< > $@
endef
# Escape any '-':
#
# - multiple (>= 2)
# - in ' -'
# - in (cache|thin)-*
# - in numerical ranges
# - in single one in '\\f.-'
define ESCAPEHYPHENS
sed -i "s+\([^\\]\)--+\1\\\-\\\-+g;s+\([^\\]\)-+\1\\\-+g" $@
sed -i -e "s+\([^\\]\)-\{7\}+\1\\\-\\\-\\\-\\\-\\\-\\\-\\\-+g" \
-e "s+\([^\\]\)-\{6\}+\1\\\-\\\-\\\-\\\-\\\-\\\-+g" \
-e "s+\([^\\]\)-\{5\}+\1\\\-\\\-\\\-\\\-\\\-+g" \
-e "s+\([^\\]\)-\{4\}+\1\\\-\\\-\\\-\\\-+g" \
-e "s+\([^\\]\)-\{3\}+\1\\\-\\\-\\\-+g" \
-e "s+\([^\\]\)-\{2\}+\1\\\-\\\-+g" \
-e "s+^-\{2\}+\\\-\\\-+g" \
-e "s+ -+ \\\-+g" \
-e "s+\(cache\)-\([[:alpha:]]\{1,\}\)+\1\\\-\2+g" \
-e "s+\(thin\)-\([[:alpha:]]\{1,\}\)+\1\\\-\2+g" \
-e "s+\([0-9]\)-\([0-9]\)+\1\\\-\2+g" \
-e "s+\(\\\f.\)-\([^-]\)+\1\\\-\2+g" \
-e "s+\([[:digit:]]\{4\}\)\\\-\([[:digit:]]\{2\}\)\\\-\([[:digit:]]\{2\}\)+\1-\2-\3+g" $@
endef
%.5: $(srcdir)/%.5_main