[PATCH 2/7] Makefile: Improve uninstall target for compressed man pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now sources and installed man pages may be in plain/gz/bz2/xz
format (independently). Any combination works reliably.

Signed-off-by: Alexander Miller <alex.miller@xxxxxx>
---
I would have preferred find -print0, but sed is line-based. As long
as there are no man page filenames with newlines, that's good enough.
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 95ffc2f..a14078c 100644
--- a/Makefile
+++ b/Makefile
@@ -29,9 +29,9 @@ screen:
 	done
 
 uninstall remove:
-	for i in man?/*; do \
-		rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".gz $(MANDIR)/"$$i".bz2; \
-	done
+	find man? -mindepth 1 -maxdepth 1 -print | \
+		sed -e 's/\.\(gz\|bz2\|xz\)$$//; s/.*/&\n&.gz\n&.bz2\n&.xz/' | \
+		(cd $(MANDIR) && xargs -d \\n rm -f)
 
 gz:
 	for i in man?; do $(GZIP) "$$i"/*; done
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux