Skip to contentSkip to conversation

master - man: de-duplicate lvmconfig, lvm-config and lvm-dumpconfig manuals

PATCH Heinz Mauelshagen 1 participant 1 message Mar 28, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6742137964757356ec25b8daad86d71ea0dbe357
Commit:        6742137964757356ec25b8daad86d71ea0dbe357
Parent:        162552041f58be8ee3fd79accc742568781b56d5
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Wed Mar 29 00:22:15 2017 +0200
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Wed Mar 29 00:22:15 2017 +0200

man: de-duplicate lvmconfig, lvm-config and lvm-dumpconfig manuals

---
 man/Makefile.in             |   38 +++-
 man/lvm-config.8_des        |    5 -
 man/lvm-config.8_pregen     |  471 -------------------------------------------
 man/lvm-dumpconfig.8_des    |    5 -
 man/lvm-dumpconfig.8_pregen |  471 -------------------------------------------
 man/lvmconfig.8_des         |    3 +-
 man/lvmconfig.8_pregen      |    3 +-
 7 files changed, 37 insertions(+), 959 deletions(-)
man/Makefile.in +33 -5
index 6b7e35c..105512c 100644
@@ -32,8 +32,8 @@ LVMRAIDMAN = lvmraid.7
 
 MAN5=lvm.conf.5
 MAN7=lvmsystemid.7 lvmreport.7 
-MAN8=lvm.8 lvmconf.8 lvmdump.8 lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 \
-     lvm-lvpoll.8 lvcreate.8 lvchange.8 lvmconfig.8 lvconvert.8 lvdisplay.8 \
+MAN8=lvm.8 lvmconf.8 lvmdump.8 lvm-fullreport.8 lvm-lvpoll.8 \
+     lvcreate.8 lvchange.8 lvmconfig.8 lvconvert.8 lvdisplay.8 \
      lvextend.8 lvreduce.8 lvremove.8 lvrename.8 lvresize.8 lvs.8 \
      lvscan.8 pvchange.8 pvck.8 pvcreate.8 pvdisplay.8 pvmove.8 pvremove.8 \
      pvresize.8 pvs.8 pvscan.8 vgcfgbackup.8 vgcfgrestore.8 vgchange.8 \
@@ -41,6 +41,7 @@ MAN8=lvm.8 lvmconf.8 lvmdump.8 lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 \
      vgimport.8 vgimportclone.8 vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 \
      vgrename.8 vgs.8 vgscan.8 vgsplit.8 \
      lvmsar.8 lvmsadc.8 lvmdiskscan.8
+MAN8SO=lvmconfig-common.8 lvmconfig.8.tmp lvm-config.8 lvm-dumpconfig.8
 MAN8DM=dmsetup.8 dmstats.8
 MAN8CLUSTER=
 MAN8SYSTEMD_GENERATORS=lvm2-activation-generator.8
@@ -122,7 +123,7 @@ TESTMAN=test.gen
 
 include $(top_builddir)/make.tmpl
 
-CLEAN_TARGETS+=$(MAN5) $(MAN7) $(MAN8) $(MAN8:%.8=%.8_gen) $(MAN8CLUSTER) \
+CLEAN_TARGETS+=$(MAN5) $(MAN7) $(MAN8) $(MAN8SO) $(MAN8:%.8=%.8_gen) $(MAN8CLUSTER) \
 	$(MAN8SYSTEMD_GENERATORS) $(MAN8DM) $(TESTMAN)
 DISTCLEAN_TARGETS+=$(FSADMMAN) $(BLKDEACTIVATEMAN) $(DMEVENTDMAN) \
 	$(LVMETADMAN) $(LVMPOLLDMAN) $(LVMLOCKDMAN) $(CLVMDMAN) $(CMIRRORDMAN) \
@@ -135,11 +136,11 @@ all: man device-mapper
 
 device-mapper: $(MAN8DM)
 
-man: $(MAN5) $(MAN7) $(MAN8) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS)
+man: $(MAN5) $(MAN7) $(MAN8) $(MAN8SO) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS)
 
 all_man: man
 
-$(MAN5) $(MAN7) $(MAN8) $(MAN8DM) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS): Makefile
+$(MAN5) $(MAN7) $(MAN8) $(MAN8SO) $(MAN8DM) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS): Makefile
 
 # Test whether or not the man page generator works
 $(TESTMAN): $(MANGENERATOR) Makefile
@@ -207,6 +208,17 @@ $(SED) -i -e "s+\([^\\]\)-\{7\}+\1\\\-\\\-\\\-\\\-\\\-\\\-\\\-+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
+
+define LVMCONFIGHEADER
+	echo ".TH $(1) 8 \"LVM TOOLS #VERSION#\" \"Red Hat, Inc.\"" | $(SED) -e "s+#VERSION#+$(LVM_VERSION)+" > $@
+	echo ".SH NAME\n" >> $@
+	echo "$(2) \\- Display and manipulate configuration information\n" >> $@
+	echo ".\n" >> $@
+	echo ".SH SYNOPSIS\n" >> $@
+	echo "\\fB$(2)\\fP\n" >> $@
+	echo ".so $<" >> $@
 endef
 
 %.5: $(srcdir)/%.5_main
@@ -225,6 +237,22 @@ endef
 	$(SUBSTVARS)
 	$(ESCAPEHYPHENS)
 
+# Create lvmconfig-common.8 to be shared by lvmconfig.8, lvm-config.8 and lvm.dumpconfig.8
+lvmconfig-common.8: lvmconfig.8
+	$(SED) -e "1,6d" $< > $@
+
+# Create headers for lvmconfig, lvm-config and lvm.dumpconfig and share lvmconfig-common.8
+# Needs temporary target to avoid conflict with %8: target above
+lvmconfig.8.tmp: lvmconfig-common.8
+	$(call LVMCONFIGHEADER,LVMCONFIG,lvmconfig)
+	mv $@ $(@:%.8.tmp=%.8)
+
+lvm-config.8: lvmconfig-common.8
+	$(call LVMCONFIGHEADER,LVM-CONFIG,lvm config)
+
+lvm-dumpconfig.8: lvmconfig-common.8
+	$(call LVMCONFIGHEADER,LVM-DUMPCONFIG,lvm dumpconfig)
+
 install_man5: $(MAN5)
 	$(INSTALL) -d $(MAN5DIR)
 	$(INSTALL_DATA) $(MAN5) $(MAN5DIR)/
man/lvm-config.8_des deleted +0 -5
deleted file mode 100644
index 046806e..0000000
@@ -1,5 +0,0 @@
-This command is the same as \fBlvmconfig\fP(8).
-
-lvm config produces formatted output from the LVM configuration tree. The
-sources of the configuration data include \fBlvm.conf\fP(5) and command
-line settings from --config.
man/lvm-config.8_end deleted +0 -0
deleted file mode 100644
index e69de29..0000000
man/lvm-config.8_pregen deleted +0 -471

471 lines not on this page · raw message

man/lvm-dumpconfig.8_des deleted +0 -5
deleted file mode 100644
index 3ebe2b3..0000000
@@ -1,5 +0,0 @@
-This command is the same as \fBlvmconfig\fP(8).
-
-lvm dumpconfig produces formatted output from the LVM configuration tree. The
-sources of the configuration data include \fBlvm.conf\fP(5) and command
-line settings from --config.
man/lvm-dumpconfig.8_end deleted +0 -0
deleted file mode 100644
index e69de29..0000000
man/lvm-dumpconfig.8_pregen deleted +0 -471

471 lines not on this page · raw message

man/lvmconfig.8_des +2 -1
index 3863d12..2398759 100644
@@ -1,3 +1,4 @@
-lvmconfig produces formatted output from the LVM configuration tree. The
+lvmconfig, lvm dumpconfig, lvm config produce
+formatted output from the LVM configuration tree. The
 sources of the configuration data include \fBlvm.conf\fP(5) and command
 line settings from --config.
man/lvmconfig.8_pregen +2 -1
index 5f2306e..ec076b2 100644
@@ -10,7 +10,8 @@ lvmconfig - Display and manipulate configuration information
     [ \fIposition_args\fP ]
 .br
 .SH DESCRIPTION
-lvmconfig produces formatted output from the LVM configuration tree. The
+lvmconfig, lvm dumpconfig, lvm config produce
+formatted output from the LVM configuration tree. The
 sources of the configuration data include \fBlvm.conf\fP(5) and command
 line settings from --config.
 .SH USAGE