Source-Changes-HG archive

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

[src/trunk]: src Add -E - "expert mode". If this is not specified, builds to...



details:   https://anonhg.NetBSD.org/src/rev/2d19edfc3476
branches:  trunk
changeset: 540273:2d19edfc3476
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Dec 08 22:14:00 2002 +0000

description:
Add -E - "expert mode".  If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...

diffstat:

 BUILDING          |   3 +++
 build.sh          |  22 ++++++++++++++++------
 doc/BUILDING.mdoc |   9 ++++++++-
 3 files changed, 27 insertions(+), 7 deletions(-)

diffs (111 lines):

diff -r fa55999477ca -r 2d19edfc3476 BUILDING
--- a/BUILDING  Sun Dec 08 21:54:03 2002 +0000
+++ b/BUILDING  Sun Dec 08 22:14:00 2002 +0000
@@ -451,6 +451,9 @@
                /var.  Note this does not build a ``release''; no release sets
                are placed in ${RELEASEDIR}.  -d is implied by -R.
 
+     -E        Set `expert' mode; DESTDIR does not have to be set to a non-
+               root path for builds when this is set.
+
      -j njob   Passed through to make(1).  Makefiles should use .WAIT or have
                explicit dependancies as necessary to enforce build ordering.
                If you see build failures with -j, please save complete build
diff -r fa55999477ca -r 2d19edfc3476 build.sh
--- a/build.sh  Sun Dec 08 21:54:03 2002 +0000
+++ b/build.sh  Sun Dec 08 22:14:00 2002 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#  $NetBSD: build.sh,v 1.73 2002/12/08 08:42:51 lukem Exp $
+#  $NetBSD: build.sh,v 1.74 2002/12/08 22:14:00 lukem Exp $
 #
 # Top level build wrapper, for a system containing no tools.
 #
@@ -104,7 +104,7 @@
 usage () {
        cat <<_usage_
 Usage:
-`basename $0` [-bdnortUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-k kernel]
+`basename $0` [-bdEnortUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-k kernel]
           [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-w wrapper]
 
     -a arch    set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
@@ -112,6 +112,7 @@
     -b         build nbmake and nbmake wrapper script, if needed
     -D dest    set DESTDIR to dest
     -d         build a full distribution into DESTDIR (including etc files)
+    -E         set "expert" mode; disables some DESTDIR checks
     -j njob    run up to njob jobs in parallel; see make(1)
     -k kernel  build a kernel using the named configuration file
     -M obj     set obj root directory to obj (sets MAKEOBJDIRPREFIX)
@@ -142,10 +143,11 @@
 do_buildtools=false
 do_rebuildmake=false
 do_removedirs=false
+expert_mode=false
 makeenv=
 makewrapper=
 opt_a=no
-opts='a:B:bD:dhj:k:M:m:nO:oR:rT:tUuw:'
+opts='a:B:bD:dEhj:k:M:m:nO:oR:rT:tUuw:'
 runcmd=
 
 if type getopts >/dev/null 2>&1; then
@@ -180,6 +182,8 @@
 
        -d)     buildtarget=distribution;;
 
+       -E)     expert_mode=true;;
+
        -j)     eval $optargcmd
                parallel="-j $OPTARG";;
 
@@ -362,8 +366,14 @@
                   [ "`uname -m`" != "$MACHINE" ]; then
                        bomb "DESTDIR must be set to a non-root path for cross builds or -d or -R."
                fi
-               $runcmd echo "===> WARNING: Building to /."
-               $runcmd echo "===> If your kernel is not up to date, this may cause the system to break!"
+               if ! $expert_mode; then
+                       bomb "DESTDIR must be set to a non-root path for non -E (expert) builds"
+               fi
+               $runcmd echo "===> WARNING: Building to /, in expert mode."
+               $runcmd echo "===>          This may cause your system to break, including if"
+               $runcmd echo "===>             - your kernel is not up to date"
+               $runcmd echo "===>             - the libraries or toolchain have changed"
+               $runcmd echo "===>          YOU HAVE BEEN WARNED!"
        fi
 else
        removedirs="$removedirs $DESTDIR"
@@ -409,7 +419,7 @@
 eval cat <<EOF $makewrapout
 #! /bin/sh
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.73 2002/12/08 08:42:51 lukem Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.74 2002/12/08 22:14:00 lukem Exp $
 #
 
 EOF
diff -r fa55999477ca -r 2d19edfc3476 doc/BUILDING.mdoc
--- a/doc/BUILDING.mdoc Sun Dec 08 21:54:03 2002 +0000
+++ b/doc/BUILDING.mdoc Sun Dec 08 22:14:00 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: BUILDING.mdoc,v 1.4 2002/12/08 08:42:52 lukem Exp $
+.\"    $NetBSD: BUILDING.mdoc,v 1.5 2002/12/08 22:14:02 lukem Exp $
 .\"
 .\" Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -822,6 +822,13 @@
 is implied by
 .Fl R .
 .
+.It Fl E
+Set
+.Sq expert
+mode;
+.Sy DESTDIR
+does not have to be set to a non-root path for builds when this is set.
+.
 .It Fl j Ar njob
 Passed through to 
 .Xr make 1 .



Home | Main Index | Thread Index | Old Index