From ca088e521032e8da4fea8e8a6d5c61b315b48309 Mon Sep 17 00:00:00 2001 From: dyoung Date: Fri, 23 Apr 2010 19:21:08 +0000 Subject: [PATCH] Do not try in postinstall(8) to replicate the code in etc/mtree/Makefile that assembles /etc/mtree/NetBSD.dist. Instead, use the Makefile's new target, emit_dist_file, to assemble the correct NetBSD.dist. Previously, 'postinstall -m amd64 -s $SRC_TOP' would install a NetBSD.dist that was missing /usr/lib/i386/ et cetera. --- etc/mtree/Makefile | 5 ++++- usr.sbin/postinstall/postinstall | 9 ++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/etc/mtree/Makefile b/etc/mtree/Makefile index 31be9bd6bfb3..8176f4961346 100644 --- a/etc/mtree/Makefile +++ b/etc/mtree/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2010/01/18 10:25:29 plunky Exp $ +# $NetBSD: Makefile,v 1.16 2010/04/23 19:21:08 dyoung Exp $ .include @@ -39,6 +39,9 @@ TOOL_MTREE.unpriv= TOOL_MTREE.unpriv= -W .endif +emit_dist_file: + ${TOOL_CAT} ${.CURDIR}/NetBSD.dist.base ${EXTRA_DIST_FILES} + distrib-dirs: .PHONY check_DESTDIR NetBSD.dist .if !defined(DISTRIBUTION_DONE) # { # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because diff --git a/usr.sbin/postinstall/postinstall b/usr.sbin/postinstall/postinstall index 9006e40ae702..6bbec9f339af 100755 --- a/usr.sbin/postinstall/postinstall +++ b/usr.sbin/postinstall/postinstall @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: postinstall,v 1.107 2009/12/24 21:52:57 christos Exp $ +# $NetBSD: postinstall,v 1.108 2010/04/23 19:21:08 dyoung Exp $ # # Copyright (c) 2002-2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -933,12 +933,7 @@ do_mtree() if ! $SOURCEMODE; then MTREE_DIR="${SRC_DIR}/etc/mtree" else - extrafile=/dev/null - if [ "${MKX11}" != "no" ]; then - get_makevar X11FLAVOUR - extrafile="${SRC_DIR}/etc/mtree/NetBSD.dist.${X11FLAVOUR}" - fi - cat "${SRC_DIR}/etc/mtree/NetBSD.dist.base" "${extrafile}" > \ + ${MAKE} -C ${SRC_DIR}/etc/mtree emit_dist_file > \ "${SCRATCHDIR}/NetBSD.dist" MTREE_DIR="${SCRATCHDIR}" fi