Source-Changes-HG archive

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

[src/trunk]: src build.sh, BUILDING: consistency improvements



details:   https://anonhg.NetBSD.org/src/rev/b55d9c1f1011
branches:  trunk
changeset: 375857:b55d9c1f1011
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue May 16 21:39:26 2023 +0000

description:
build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?

diffstat:

 BUILDING          |  35 +++++++++++++++++++++--------------
 build.sh          |  51 +++++++++++++++++++++++++++------------------------
 doc/BUILDING.mdoc |  46 ++++++++++++++++++++++++++++++----------------
 3 files changed, 78 insertions(+), 54 deletions(-)

diffs (truncated from 475 to 300 lines):

diff -r c93a401a6908 -r b55d9c1f1011 BUILDING
--- a/BUILDING  Tue May 16 21:21:38 2023 +0000
+++ b/BUILDING  Tue May 16 21:39:26 2023 +0000
@@ -168,7 +168,7 @@ CONFIGURATION
                  directory names, and can be consulted in the make(1)
                  configuration file in order to set additional build
                  parameters, such as compiler flags.  It will also be used as
-                 part of the kernel version string, which can be printed by
+                 part of the kernel version string, which can be shown by
                  "uname -v".
 
                  Default: Unset.
@@ -225,15 +225,15 @@ CONFIGURATION
 
                  1    Brief messages are shown describing what is being done,
                       but the actual commands executed by make(1) are not
-                      displayed.
+                      shown.
 
                  2    Descriptive messages are shown as above (prefixed with a
                       `#'), and ordinary commands performed by make(1) are
-                      displayed.
+                      shown.
 
                  3    In addition to the above, all commands performed by
-                      make(1) are displayed, even if they would ordinarily
-                      have been hidden through use of the "@" prefix in the
+                      make(1) are shown, even if they would ordinarily have
+                      been hidden through use of the "@" prefix in the
                       relevant makefile.
 
                  4    In addition to the above, commands executed by make(1)
@@ -553,11 +553,11 @@ BUILDING
                 automatically when building from the top level, or when using
                 build.sh.
 
-     -n         Display the commands that would have been executed, but do not
+     -n         Show the commands that would have been executed, but do not
                 actually execute them.  This will still cause recursion to
                 take place.
 
-     -V var     Print make(1)'s idea of the value of var.  Does not build any
+     -V var     Show make(1)'s idea of the value of var.  Does not build any
                 targets.
 
      var=value  Set the variable var to value, overriding any setting
@@ -777,7 +777,7 @@ BUILDING
            ${HOST_SH} build.sh [options]
 
      If build.sh detects that it is being executed under an unsuitable shell,
-     it attempts to exec a suitable shell instead, or prints an error message.
+     it attempts to exec a suitable shell instead, or shows an error message.
      If HOST_SH is not set explicitly, then build.sh sets a default using
      heuristics dependent on the host platform, or from the shell under which
      build.sh is executed (if that can be determined), or using the first copy
@@ -806,6 +806,8 @@ BUILDING
      release       Build a full release as per "make release".  This command
                    first runs the distribution operation.
 
+     help          Show a help message, and exit.
+
      makewrapper   Create the nbmake-MACHINE wrapper.  This operation is
                    automatically performed for any of the other operations.
 
@@ -877,8 +879,8 @@ BUILDING
 
      live-image    Perform "make live-image".
 
-     list-arch     Prints a list of valid MACHINE and MACHINE_ARCH settings,
-                   the default MACHINE_ARCH for each MACHINE, and aliases for
+     list-arch     Show a list of valid MACHINE and MACHINE_ARCH settings, the
+                   default MACHINE_ARCH for each MACHINE, and aliases for
                    MACHINE/MACHINE_ARCH pairs, and then exits.  The -m or -a
                    options (or both) may be used to specify glob patterns that
                    will be used to narrow the list of results; for example,
@@ -933,7 +935,7 @@ BUILDING
                Note: It is highly recommended that you know what you are doing
                when you use this option.
 
-     -h        Print a help message.
+     -h        Show a help message, and exit.
 
      -j njob   Run up to njob make(1) subjobs in parallel; passed through to
                make(1).  If you see failures for reasons other than running
@@ -1018,6 +1020,9 @@ BUILDING
                automatically set to "yes".  This default is opposite to the
                behaviour when not using build.sh.
 
+     -P        Set the value of MKREPRO and MKREPRO_TIMESTAMP to the latest
+               source CVS timestamp for reproducible builds.
+
      -R rel    Set the value of RELEASEDIR to rel.  If a relative path is
                specified, it will be converted to an absolute path before
                being used.
@@ -1060,6 +1065,8 @@ BUILDING
      -Z var    Unset ("zap") the environment variable var.  This is propagated
                to the nbmake wrapper.
 
+     -?        Show a help message, and exit.
+
    The "nbmake-MACHINE" wrapper script
      If using the build.sh script to build NetBSD, a nbmake-MACHINE script
      will be created in TOOLDIR/bin upon the first build to assist in building
@@ -1083,7 +1090,7 @@ EXAMPLES
      2.   % ./build.sh [options] -U distribution
 
           Using unprivileged mode, build a complete distribution to a DESTDIR
-          directory that build.sh selects (and will display).
+          directory that build.sh selects (and will show).
 
      3.   # ./build.sh [options] -U install=/
 
@@ -1095,7 +1102,7 @@ EXAMPLES
      4.   % ./build.sh [options] -U -u release
 
           Using unprivileged mode, build a complete release to DESTDIR and
-          RELEASEDIR directories that build.sh selects (and will display).
+          RELEASEDIR directories that build.sh selects (and will show).
           MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if
           this is run after example 2, it doesn't need to redo that portion of
           the release build.
@@ -1121,4 +1128,4 @@ CAVEATS
      in object directories.  Instead, one may have to manually remove the
      files.  Consult the UPDATING file for notices concerning this.
 
-NetBSD                         October 13, 2020                         NetBSD
+NetBSD                           May 16, 2023                           NetBSD
diff -r c93a401a6908 -r b55d9c1f1011 build.sh
--- a/build.sh  Tue May 16 21:21:38 2023 +0000
+++ b/build.sh  Tue May 16 21:39:26 2023 +0000
@@ -1,7 +1,7 @@
 #! /usr/bin/env sh
-#      $NetBSD: build.sh,v 1.368 2023/04/23 09:54:15 uwe Exp $
+#      $NetBSD: build.sh,v 1.369 2023/05/16 21:39:26 lukem Exp $
 #
-# Copyright (c) 2001-2022 The NetBSD Foundation, Inc.
+# Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -38,7 +38,7 @@
 # We try to determine whether or not this script is being run under
 # a shell that supports the features that we use.  If not, we try to
 # re-exec the script under another shell.  If we can't find another
-# suitable shell, then we print a message and exit.
+# suitable shell, then we show a message and exit.
 #
 
 errmsg=''              # error message, if not empty
@@ -358,8 +358,8 @@ warning()
        statusmsg "Warning: $@"
 }
 
-# Find a program in the PATH, and print the result.  If not found,
-# print a default.  If $2 is defined (even if it is an empty string),
+# Find a program in the PATH, and show the result.  If not found,
+# show a default.  If $2 is defined (even if it is an empty string),
 # then that is the default; otherwise, $1 is used as the default.
 #
 find_in_PATH()
@@ -490,7 +490,7 @@ level of source directory"
        #
        # Note that "uname -p" is not part of POSIX, but we want uname_p
        # to be set to the host MACHINE_ARCH, if possible.  On systems
-       # where "uname -p" fails, prints "unknown", or prints a string
+       # where "uname -p" fails, shows "unknown", or shows a string
        # that does not look like an identifier, fall back to using the
        # output from "uname -m" instead.
        #
@@ -906,7 +906,7 @@ listarch()
 }
 
 # nobomb_getmakevar --
-# Given the name of a make variable in $1, print make's idea of the
+# Given the name of a make variable in $1, show make's idea of the
 # value of that variable, or return 1 if there's an error.
 #
 nobomb_getmakevar()
@@ -921,7 +921,7 @@ EOF
 }
 
 # bomb_getmakevar --
-# Given the name of a make variable in $1, print make's idea of the
+# Given the name of a make variable in $1, show make's idea of the
 # value of that variable, or bomb if there's an error.
 #
 bomb_getmakevar()
@@ -931,8 +931,8 @@ bomb_getmakevar()
 }
 
 # getmakevar --
-# Given the name of a make variable in $1, print make's idea of the
-# value of that variable, or print a literal '$' followed by the
+# Given the name of a make variable in $1, show make's idea of the
+# value of that variable, or show a literal '$' followed by the
 # variable name if ${make} is not executable.  This is intended for use in
 # messages that need to be readable even if $make hasn't been built,
 # such as when build.sh is run with the "-n" option.
@@ -1022,7 +1022,8 @@ resolvepath()
        eval ${var}=\"\${val}\"
 }
 
-# Display synopsis to stdout.
+# Show synopsis to stdout.
+#
 synopsis()
 {
        cat <<_usage_
@@ -1038,7 +1039,7 @@ Usage: ${progname} [-EnoPRrUux] [-a ARCH
 _usage_
 }
 
-# Display help to stdout.
+# Show help to stdout.
 #
 help()
 {
@@ -1050,7 +1051,7 @@ help()
     release             Run "make release" (includes kernels & distrib media).
 
  Other OPERATIONs:
-    help                Show this message and exit.
+    help                Show this help message, and exit.
     makewrapper         Create ${toolprefix}make-\${MACHINE} wrapper and ${toolprefix}make.
                         Always performed.
     cleandir            Run "make cleandir".  [Default unless -u is used]
@@ -1083,8 +1084,8 @@ help()
                         RELEASEDIR/RELEASEMACHINEDIR/installation/installimage.
     disk-image=TARGET   Create bootable disk image in
                         RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/TARGET.img.gz.
-    params              Display various make(1) parameters.
-    list-arch           Display a list of valid MACHINE/MACHINE_ARCH values,
+    params              Show various make(1) parameters.
+    list-arch           Show a list of valid MACHINE/MACHINE_ARCH values,
                         and exit.  The list may be narrowed by passing glob
                         patterns or exact values in MACHINE or MACHINE_ARCH.
     mkrepro-timestamp   Show the latest source timestamp used for reproducable
@@ -1102,7 +1103,7 @@ help()
     -E             Set "expert" mode; disables various safety checks.
                    Should not be used without expert knowledge of the build
                    system.
-    -h             Print this help message, and exit.
+    -h             Show this help message, and exit.
     -j NJOB        Run up to NJOB jobs in parallel; see make(1) -j.
     -M MOBJ        Set obj root directory to MOBJ; sets MAKEOBJDIRPREFIX=MOBJ,
                    unsets MAKEOBJDIR.
@@ -1143,12 +1144,12 @@ help()
     -X X11SRC      Set X11SRCDIR=X11SRC.  [Default: /usr/xsrc]
     -x             Set MKX11=yes; build X11 from X11SRCDIR.
     -Z VAR         Unset ("zap") variable VAR.
-    -?             Print this help message, and exit.
+    -?             Show this help message, and exit.
 
 _usage_
 }
 
-# Display optional error message, help to stderr, and exit 1.
+# Show optional error message, help to stderr, and exit 1.
 #
 usage()
 {
@@ -1559,9 +1560,10 @@ sanitycheck()
        done
 }
 
-# print_tooldir_make --
-# Try to find and print a path to an existing
+# print_tooldir_program --
+# Try to find and show a path to an existing
 # ${TOOLDIR}/bin/${toolprefix}program
+#
 print_tooldir_program()
 {
        local possible_TOP_OBJ
@@ -1615,8 +1617,9 @@ print_tooldir_program()
        done
        echo ""
 }
+
 # print_tooldir_make --
-# Try to find and print a path to an existing
+# Try to find and show a path to an existing
 # ${TOOLDIR}/bin/${toolprefix}make, for use by rebuildmake() before a
 # new version of ${toolprefix}make has been built.
 #
@@ -1634,7 +1637,7 @@ print_tooldir_program()
 #   nobomb_getmakevar to find the correct value for TOOLDIR, and believe the
 #   result only if it's a directory that already exists;
 # * If a value of TOOLDIR was found above, and if
-#   ${TOOLDIR}/bin/${toolprefix}make exists, print that value.
+#   ${TOOLDIR}/bin/${toolprefix}make exists, show that value.
 #
 print_tooldir_make()
 {
@@ -1758,7 +1761,7 @@ rebuildmake()
 # Creates the top-level obj directory, because that
 # is needed by some of the sanity checks.
 #
-# Prints status messages reporting the values of several variables.
+# Shows status messages reporting the values of several variables.



Home | Main Index | Thread Index | Old Index