Fix installation of manpages with WITHOUT_COMPRESS broken since r284685.

This partially reverts r284685.  An attempt was made in r285295 to fix this
but was not enough.  There were still $${} vars in the code that should have
been using the ${_page} and ${_sect} vars, but the bigger problem was that
.for cannot be used on .ALLSRC as it is not defined when the .for is evaluated.

Using ${MAN} here in a .for loop doesn't work either as the paths are not
expanded right for lib/libc/ subdirs despite having a .PATH set for all
of them.

Add some comments around long .else and .endif as well.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2015-10-22 22:29:25 +00:00
parent 4a875c71d5
commit a305a56ce1

View File

@ -104,8 +104,8 @@ ${__target}: ${__page}
.endfor
.endif
.endfor
.endif
.else
.endif # !empty(MAN)
.else # !defined(MANFILTER)
.if defined(MAN) && !empty(MAN)
CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g}
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
@ -120,9 +120,9 @@ ${__target}: ${__page}
_manpages: ${MAN}
.endif
.endif
.endif
.endif # defined(MANFILTER)
.else
.else # ${MK_MANCOMPRESS} == "yes"
ZEXT= ${MCOMPRESS_EXT}
@ -169,7 +169,7 @@ ${__target}: ${__page}
.endfor
.endif
.endif
.endif # ${MK_MANCOMPRESS} == "no"
maninstall: _maninstall
_maninstall:
@ -185,20 +185,26 @@ _maninstall: ${MAN}
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page}
.endif
.endfor
.else
.for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}
@d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \
${ECHO} ${MINSTALL} ${_page} $${d}; \
${MINSTALL} $${page} $${d};
.endfor
.else # !defined(MANFILTER)
@set ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}; \
while : ; do \
case $$# in \
0) break;; \
1) echo "warn: missing extension: $$1"; break;; \
esac; \
page=$$1; shift; sect=$$1; shift; \
d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \
${ECHO} ${MINSTALL} $${page} $${d}; \
${MINSTALL} $${page} $${d}; \
done
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
.for __page in ${MAN}
${MINSTALL} ${__page:T:S/$/${CATEXT}/} \
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T}
.endfor
.endif
.endif
.else
.endif # defined(MANFILTER)
.else # ${MK_MANCOMPRESS} == "yes"
.for __page in ${MAN}
${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \
${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/
@ -207,7 +213,7 @@ _maninstall: ${MAN}
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/}
.endif
.endfor
.endif
.endif # ${MK_MANCOMPRESS} == "no"
.endif
.if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS)