Source-Changes-HG archive

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

[src/trunk]: src Move the "-U or -E must be set for build as an unprivileged ...



details:   https://anonhg.NetBSD.org/src/rev/b1c296b3a2df
branches:  trunk
changeset: 326658:b1c296b3a2df
user:      apb <apb%NetBSD.org@localhost>
date:      Mon Feb 10 08:20:05 2014 +0000

description:
Move the "-U or -E must be set for build as an unprivileged user."
test from sanitycheck() to validatemakeparams().  If MKUNPRIVED is set
in mk.conf (and not on the build.sh command line) then it's not yet
available for use in the sanitycheck function.

Also move some other code for consistency.

diffstat:

 build.sh |  36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (72 lines):

diff -r 08d871d41aa2 -r b1c296b3a2df build.sh
--- a/build.sh  Mon Feb 10 06:36:53 2014 +0000
+++ b/build.sh  Mon Feb 10 08:20:05 2014 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#      $NetBSD: build.sh,v 1.274 2014/01/13 20:00:20 apb Exp $
+#      $NetBSD: build.sh,v 1.275 2014/02/10 08:20:05 apb Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1282,14 +1282,6 @@
 #
 sanitycheck()
 {
-       # Non-root should always use either the -U or -E flag.
-       #
-       if ! ${do_expertmode} && \
-           [ "$id_u" -ne 0 ] && \
-           [ "${MKUNPRIVED:-no}" = "no" ] ; then
-               bomb "-U or -E must be set for build as an unprivileged user."
-       fi
-
        # Install as non-root is a bad idea.
        #
        if ${do_install} && [ "$id_u" -ne 0 ] ; then
@@ -1515,6 +1507,22 @@
                statusmsg2 "MAKECONF file:" "${MAKECONF} (File not found)"
        fi
 
+       # Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE.
+       # These may be set as build.sh options or in "mk.conf".
+       # Don't export them as they're only used for tests in build.sh.
+       #
+       MKOBJDIRS=$(getmakevar MKOBJDIRS)
+       MKUNPRIVED=$(getmakevar MKUNPRIVED)
+       MKUPDATE=$(getmakevar MKUPDATE)
+
+       # Non-root should always use either the -U or -E flag.
+       #
+       if ! ${do_expertmode} && \
+           [ "$id_u" -ne 0 ] && \
+           [ "${MKUNPRIVED}" = "no" ] ; then
+               bomb "-U or -E must be set for build as an unprivileged user."
+       fi
+
        if [ "${runcmd}" = "echo" ]; then
                TOOLCHAIN_MISSING=no
                EXTERNAL_TOOLCHAIN=""
@@ -1536,14 +1544,6 @@
                exit 1
        fi
 
-       # Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE
-       # These may be set as build.sh options or in "mk.conf".
-       # Don't export them as they're only used for tests in build.sh.
-       #
-       MKOBJDIRS=$(getmakevar MKOBJDIRS)
-       MKUNPRIVED=$(getmakevar MKUNPRIVED)
-       MKUPDATE=$(getmakevar MKUPDATE)
-
        if [ "${MKOBJDIRS}" != "no" ]; then
                # Create the top-level object directory.
                #
@@ -1745,7 +1745,7 @@
        eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.274 2014/01/13 20:00:20 apb Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.275 2014/02/10 08:20:05 apb Exp $
 # with these arguments: ${_args}
 #
 



Home | Main Index | Thread Index | Old Index