etcupdate: Make nobuild the default

The common case for etcupdate is to run it after building and installing
the world, in which case we already have an object directory to draw on.
Add a -b option to turn nobuild off (opposite of -B), and turn nobuild
on by default.

MFC after:	1 week
Reviewed by:	jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D57306
This commit is contained in:
Dag-Erling Smørgrav
2026-06-05 17:53:25 +02:00
parent c606eb3713
commit ddf6fad029
2 changed files with 22 additions and 15 deletions
+17 -13
View File
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd April 30, 2026 .Dd May 27, 2026
.Dt ETCUPDATE 8 .Dt ETCUPDATE 8
.Os .Os
.Sh NAME .Sh NAME
@@ -31,7 +31,8 @@
.Nd "manage updates to system files not updated by installworld" .Nd "manage updates to system files not updated by installworld"
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl npBFN .Op Fl npFN
.Op Fl B | Fl b
.Op Fl d Ar workdir .Op Fl d Ar workdir
.Op Fl r | Fl s Ar source | Fl t Ar tarball .Op Fl r | Fl s Ar source | Fl t Ar tarball
.Op Fl A Ar patterns .Op Fl A Ar patterns
@@ -42,7 +43,8 @@
.Op Fl m Ar make .Op Fl m Ar make
.Nm .Nm
.Cm build .Cm build
.Op Fl BN .Op Fl N
.Op Fl B | Fl b
.Op Fl d Ar workdir .Op Fl d Ar workdir
.Op Fl s Ar source .Op Fl s Ar source
.Op Fl L Ar logfile .Op Fl L Ar logfile
@@ -58,7 +60,8 @@
.Op Fl L Ar logfile .Op Fl L Ar logfile
.Nm .Nm
.Cm extract .Cm extract
.Op Fl BN .Op Fl N
.Op Fl B | Fl b
.Op Fl d Ar workdir .Op Fl d Ar workdir
.Op Fl s Ar source | Fl t Ar tarball .Op Fl s Ar source | Fl t Ar tarball
.Op Fl D Ar destdir .Op Fl D Ar destdir
@@ -388,15 +391,16 @@ variable or the
option will not be installed. option will not be installed.
.It Fl B .It Fl B
Do not build generated files in a private object tree. Do not build generated files in a private object tree.
Instead, Instead, reuse the generated files from a previously built object tree
reuse the generated files from a previously built object tree that matches that matches the source tree.
the source tree. This is the default.
This can be useful to avoid gratuitous conflicts in .It Fl b
.Xr sendmail 8 Build generated files in a private object tree before trying to
configuration compare anything.
files when bootstrapping. This is necessary in the uncommon case where
It can also be useful for building a tarball that matches a specific .Nm
world build. is not run after a
.Cm buildworld .
.It Fl D Ar destdir .It Fl D Ar destdir
Specify an alternate destination directory as the target of a merge. Specify an alternate destination directory as the target of a merge.
This is analogous to the This is analogous to the
+5 -2
View File
@@ -1780,12 +1780,15 @@ rerun=
always= always=
dryrun= dryrun=
ignore= ignore=
nobuild= nobuild=YES
preworld= preworld=
noroot= noroot=
difflistonly= difflistonly=
while getopts "d:lm:nprs:t:A:BD:FI:L:M:N" option; do while getopts "bd:lm:nprs:t:A:BD:FI:L:M:N" option; do
case "$option" in case "$option" in
b)
nobuild=
;;
d) d)
WORKDIR=$OPTARG WORKDIR=$OPTARG
;; ;;