Rework the mtree portion of etc/Makefile's distrib-dirs target to run

mtree in a shell loop so there is only one mtree commandline.  Move the
implementation of LOCAL_MTREE into etc/Makefile.

Sponsored by:	DARPA, AFRL
Reviewed by:	mtree :)
This commit is contained in:
Brooks Davis 2013-01-17 18:32:30 +00:00
parent c109162f52
commit 75534bda19
2 changed files with 25 additions and 18 deletions

View File

@ -717,7 +717,7 @@ distributeworld installworld: installcheck
.endfor
-mkdir ${DESTDIR}/${DISTDIR}/base
${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \
DESTDIR=${DESTDIR}/${DISTDIR}/base
LOCAL_MTREE=${LOCAL_MTREE} DESTDIR=${DESTDIR}/${DISTDIR}/base
.endif
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
${IMAKEENV} rm -rf ${INSTALLTMP}
@ -1248,11 +1248,7 @@ cross-tools:
# hierarchy - ensure that all the needed directories are present
#
hierarchy hier:
cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
.for _mtree in ${LOCAL_MTREE}
mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/${_mtree} \
-p ${DESTDIR}/
.endfor
cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
#
# libraries - build all libraries, and install them under ${DESTDIR}.

View File

@ -293,26 +293,37 @@ distribution:
MTREE_CMD?= mtree
distrib-dirs:
${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \
-p ${DESTDIR}/usr/include
MTREES= mtree/BSD.root.dist / \
mtree/BSD.var.dist /var \
mtree/BSD.usr.dist /usr \
mtree/BSD.include.dist /usr/include
.if ${MK_BIND_LIBS} != "no"
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
-p ${DESTDIR}/usr/include
MTREES+= mtree/BIND.include.dist /usr/include
.endif
.if ${MK_BIND_MTREE} != "no"
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
-p ${DESTDIR}/var/named
MTREES+= mtree/BIND.chroot.dist /var/named
.endif
.if ${MK_GROFF} != "no"
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr
MTREES+= mtree/BSD.groff.dist /usr
.endif
.if ${MK_SENDMAIL} != "no"
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
MTREES+= mtree/BSD.sendmail.dist /
.endif
.for mtree in ${LOCAL_MTREE}
MTREES+= ../${mtree} /
.endfor
distrib-dirs:
@set ${MTREES}; \
while test $$# -ge 2; do \
m=${.CURDIR}/$$1; \
shift; \
d=${DESTDIR}$$1; \
shift; \
${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
-f $$m -p $$d; \
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
done; true
cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .