Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall Simplify previous, pass awk as TOOL_AWK...



details:   https://anonhg.NetBSD.org/src/rev/da62e594a7fe
branches:  trunk
changeset: 809326:da62e594a7fe
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jul 02 09:31:56 2015 +0000

description:
Simplify previous, pass awk as TOOL_AWK (that is what the makefile uses),
create an obj dir for make and force it to use that.
This version now works with read-only source again.

diffstat:

 usr.sbin/postinstall/postinstall |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r fe2a476e3445 -r da62e594a7fe usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Thu Jul 02 09:05:06 2015 +0000
+++ b/usr.sbin/postinstall/postinstall  Thu Jul 02 09:31:56 2015 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.194 2015/07/01 12:40:07 martin Exp $
+# $NetBSD: postinstall,v 1.195 2015/07/02 09:31:56 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1178,11 +1178,13 @@
        if ! $SOURCEMODE; then
                MTREE_DIR="${SRC_DIR}/etc/mtree"
        else
-               env AWK={$AWK:Q} ${MAKE} -s -C "${SRC_DIR}/etc/mtree" emit_dist_file > \
-                   "${SCRATCHDIR}/NetBSD.dist"
-               ${MAKE} -s -C "${SRC_DIR}/etc/mtree" clean >/dev/null 2>&1
+               /bin/rm -rf "${SCRATCHDIR}/obj"
+               mkdir "${SCRATCHDIR}/obj"
+               ${MAKE} -s -C "${SRC_DIR}/etc/mtree" TOOL_AWK="${AWK}" \
+                   MAKEOBJDIR="${SCRATCHDIR}/obj" emit_dist_file > \
                    "${SCRATCHDIR}/NetBSD.dist"
                MTREE_DIR="${SCRATCHDIR}"
+               /bin/rm -rf "${SCRATCHDIR}/obj"
        fi
        compare_dir "$1" "${MTREE_DIR}" "${DEST_DIR}/etc/mtree" 444 NetBSD.dist
        failed=$(( ${failed} + $? ))



Home | Main Index | Thread Index | Old Index