.\" $NetBSD: etcupdate.8,v 1.6 2003/03/03 14:07:12 martti Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Martti Kuparinen. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the NetBSD .\" Foundation, Inc. and its contributors. .\" 4. Neither the name of The NetBSD Foundation nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd January 24, 2003 .Dt ETCUPDATE 8 .Os .Sh NAME .Nm etcupdate .Nd update the configuration and startup files in .Pa /etc .Sh SYNOPSIS .Nm .Op Fl a .Op Fl b Ar srcdir .Op Fl h .Op Fl p Ar pager .Op Fl s Ar srcdir .Op Fl t Ar temproot .Op Fl v .Op Fl w Ar width .Sh DESCRIPTION .Nm is a tool to update the configuration and startup files in .Pa /etc (and some other directories like .Pa /dev , .Pa /root and .Pa /var ) without the need of manually checking and modifying every file. The user should run this script after performing an operating system update (e.g. after running .Pa make build in .Pa /usr/src or after extracting the binary distribution files) to use the latest configuration and startup files. .Pp If the user is updating from sources (which is the default mode), .Nm will first create a copy of the new configuration and startup files by running .Pa make distribution in .Pa /usr/src/etc . .Pp Instead of using sources, the user can also extract one or more binary distribution sets and use those files to update the currently installed files (see usage of the .Fl b Ar srcdir argument later in this manual page). Files in .Pa srcdir will be removed by .Nm when using the .Fl b Ar srcdir argument (as the .Pa srcdir directory is treated like .Pa temproot ) . .Pp .Nm compares the new files against the currently installed files. The user is given the option of installing, merging or deleting each modified or missing file. .Nm also detects if the user installs certain special files and performs corresponding tasks like remaking device nodes or rebuilding a database from the .Xr aliases 5 file. .Pp .Nm can automatically update files which have not been modified locally. The .Fl a flag instructs .Nm to store MD5 checksums in .Pa /var/etcupdate and use these checksums to determine if there have been any local modifications. .Sh ENVIRONMENT .Bl -tag -width TEMPROOT .It Ev TEMPROOT The temporary files created from .Pa /usr/src/etc will be stored here. These files will then be compared against the currently installed files in the .Pa /etc directory. By default this is .Pa /tmp/temproot but it can be changed either with the .Fl t Ar temproot argument or by defining the .Ev TEMPROOT variable. .It Ev SRCDIR The location of the .Nx sources files. By default this is .Pa /usr/src/etc but it can be changed either with the .Fl s Ar srcdir argument or by defining the .Ev SRCDIR variable. .It Ev PAGER The pager to use when displaying files. By default this is .Xr more 1 but it can be changed either with the .Fl p Ar pager argument or by defining the .Ev PAGER variable. .It Ev WIDTH The screen width used during interactive merge. By default this is 80 but it can be changed either with the .Fl w Ar width argument or by defining the .Ev WIDTH variable. This is useful for .Xr xterm 1 users with wider shell windows. .It Ev IGNOREFILES A list of files that .Nm should ignore. Files listed in this variable will never be considered for updating by .Nm . .El .Sh FILES The environment variables can also be defined in the following configuration files. The user's personal configuration file settings override the global settings. .Pp /etc/etcupdate.conf .Pp ~/.etcupdaterc .Sh EXAMPLES You have just upgraded your .Nx host from 1.6 to 1.6.1 and now it's time to update the configuration files as well. To update the configuration files from the sources (if you have the .Pa /usr/src/etc directory): .Pp .Dl etcupdate .Pp The default location of the source files is .Pa /usr/src/etc but this may be overridden with the .Fl s Ar srcdir command line argument: .Pp .Dl etcupdate -s /some/where/src/etc .Pp To update the configuration files from binary distribution sets do something like this: .Pp .Dl mkdir /tmp/temproot .Dl cd /tmp/temproot .Dl tar xpzf /some/where/etc.tgz .Dl etcupdate -b /tmp/temproot .Pp You have modified only few files in the .Pa /etc directory so you would like install most of the updates without being asked. To automatically update the unmodified configuration files: .Pp .Dl etcupdate -a .Pp To get a better idea what's going on, use the .Fl v flag: .Pp .Dl etcupdate -v .Sh HISTORY The .Nm command appeared in .Nx 1.6 . .Sh AUTHORS The script was written by .An Martti Kuparinen .Aq martti@NetBSD.org and improved by several other .Nx users. .Pp The idea for this script (including code fragments, variable names etc.) came from the .Fx mergemaster (by Douglas Barton). Unlike the .Fx mergemaster, this does not use CVS version tags to compare if the files need to be updated. Files are compared with .Xr cmp 1 as this is more reliable and the only way if the version numbers are the same even though the files are different. .\" when exactly are the version the same even though the file changes? .\" .Pp .\" .Sh BUGS .\" Because of the use of .\" .Xr cmp 1 .\" to compare files, rather than CVS versions, files that are locally changed .\" from the distribution are always considered needing to be updated.