Makefile.inc1: Cleanup (un)compressed manpages

When switching between compressed and uncompressed manual pages, the
other type is left behind as divots. Compensate by removing the
now-unwanted man pages automatically.

Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1295
This commit is contained in:
Ricardo Branco
2024-06-16 20:39:49 +02:00
committed by Warner Losh
parent 4acd63a626
commit f580578877
2 changed files with 38 additions and 4 deletions
+36
View File
@@ -3512,6 +3512,25 @@ delete-old-files: .PHONY
rm ${RM_I} $${catpage} <&3; \ rm ${RM_I} $${catpage} <&3; \
fi; \ fi; \
done done
# Remove compressed copies of uncompressed manpages
.if ${MK_MANCOMPRESS} != "yes"
@exec 3<&0; \
find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \
while read manpage; do \
if [ -e "$${manpage}.gz" ]; then \
rm ${RM_I} $${manpage}.gz <&3; \
fi; \
done
# Remove uncompressed copies of compressed manpages
.else
@exec 3<&0; \
find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \
while read manpage; do \
if [ -e "$${manpage}.gz" ]; then \
rm ${RM_I} $${manpage} <&3; \
fi; \
done
.endif
@echo ">>> Old files removed" @echo ">>> Old files removed"
check-old-files: .PHONY check-old-files: .PHONY
@@ -3537,6 +3556,23 @@ check-old-files: .PHONY
echo $${catpage}; \ echo $${catpage}; \
fi; \ fi; \
done | sort done | sort
# Check for compressed copies of uncompressed manpages
.if ${MK_MANCOMPRESS} != "yes"
@find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \
while read manpage; do \
if [ -e "$${manpage}.gz" ]; then \
echo $${manpage}.gz; \
fi; \
done | sort
# Check for uncompressed copies of compressed manpages
.else
@find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \
while read manpage; do \
if [ -e "$${manpage}.gz" ]; then \
echo $${manpage}; \
fi; \
done | sort
.endif
list-old-libs: .PHONY list-old-libs: .PHONY
@cd ${.CURDIR}; \ @cd ${.CURDIR}; \
+2 -4
View File
@@ -237,11 +237,9 @@ maninstall: ${MAN}
# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x. # On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
.if ${.MAKE.OS} != "Darwin" || ${l:tu} != ${t:tu} .if ${.MAKE.OS} != "Darwin" || ${l:tu} != ${t:tu}
.if ${MK_MANSPLITPKG} == "no" .if ${MK_MANSPLITPKG} == "no"
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.else .else
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ ${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.endif .endif
.endif .endif
.endfor .endfor