xref: /netbsd/usr.sbin/etcupdate/etcupdate.8 (revision bf9ec67e)
1.\"	$NetBSD: etcupdate.8,v 1.1 2002/03/22 10:10:57 martti Exp $
2.\"
3.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Martti Kuparinen.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd March 22, 2002
38.Dt ETCUPDATE 8
39.Os
40.Sh NAME
41.Nm etcupdate
42.Nd update the configuration and startup files in
43.Pa /etc
44.Sh SYNOPSIS
45.Nm
46.Op Fl b Ar srcdir
47.Op Fl h
48.Op Fl p Ar pager
49.Op Fl s Ar srcdir
50.Op Fl t Ar temproot
51.Op Fl v
52.Op Fl w Ar width
53.Sh DESCRIPTION
54.Nm
55is a tool to update the configuration and startup files in
56.Pa /etc
57(and some other directories like
58.Pa /dev ,
59.Pa /root
60and
61.Pa /var )
62without the need of manually checking and modifying every file.
63The user should run this script after performing an operating system
64update (e.g. after running
65.Pa make build
66in
67.Pa /usr/src
68or after extracting the binary distribution files)
69to use the latest configuration and startup files.
70.Pp
71If the user is updating from sources (which is the default mode),
72.Nm
73will first create a copy of the new configuration and startup files
74by running
75.Pa make distribution
76in
77.Pa /usr/src/etc .
78.Pp
79Instead of using sources, the user can also extract one or more binary
80distribution sets and use those files to update the currently installed
81files (see usage of the
82.Fl b Ar srcdir
83argument later in this manual page).
84Files in
85.Pa srcdir
86will be removed by
87.Nm
88when using the
89.Fl b Ar srcdir
90argument (as the
91.Pa srcdir
92directory is treated like
93.Pa temproot ) .
94.Pp
95.Nm
96compares the new files against the currently installed files.
97The user is given the option of installing, merging or deleting each
98modified or missing file.
99.Nm
100also detects if the user installs certain special files and performs
101corresponding tasks like remaking device nodes or rebuilding a database
102from the
103.Xr aliases 5
104file.
105.Sh ENVIRONMENT
106.Bl -tag -width TEMPROOT
107.It Ev TEMPROOT
108The temporary files created from
109.Pa /usr/src/etc
110will be stored here.  These files will then be compared
111against the currently installed files in the
112.Pa /etc
113directory.  By default this is
114.Pa /tmp/temproot
115but it can be changed either with the
116.Fl t Ar temproot
117argument or by defining the
118.Ev TEMPROOT
119variable.
120.It Ev SRCDIR
121The location of the
122.Nx
123sources files.  By default this is
124.Pa /usr/src/etc
125but it can be changed either with the
126.Fl s Ar srcdir
127argument or by defining the
128.Ev SRCDIR
129variable.
130.It Ev PAGER
131The pager to use when displaying files.  By default this is
132.Xr more 1
133but it can be changed either with the
134.Fl p Ar pager
135argument or by defining the
136.Ev PAGER
137variable.
138.It Ev WIDTH
139The screen width used during interactive merge. By default this is
14080 but it can be changed either with the
141.Fl w Ar width
142argument or by defining the
143.Ev WIDTH
144variable.
145This is useful for
146.Xr xterm 1
147users with wider shell windows.
148.El
149.Sh FILES
150The environment variables can also be defined in the following configuration
151files.  The user's personal configuration file settings override the global
152settings.
153.Pp
154/etc/etcupdate.conf
155.Pp
156~/.etcupdaterc
157.Sh EXAMPLES
158You have just upgraded your
159.Nx
160host from 1.6 to 1.6.1 and now it's time
161to update the configuration files as well.
162To update the configuration files from the sources (if you have the
163.Pa /usr/src/etc
164directory):
165.Pp
166.Dl etcupdate
167.Pp
168The default location of the source files is
169.Pa /usr/src/etc
170but this may be overridden with the
171.Fl s Ar srcdir
172command line argument:
173.Pp
174.Dl etcupdate -s /some/where/src/etc
175.Pp
176To update the configuration files from binary distribution sets
177do something like this:
178.Pp
179.Dl mkdir /tmp/temproot
180.Dl cd /tmp/temproot
181.Dl tar xpzf /some/where/etc.tgz
182.Dl etcupdate -b /tmp/temproot
183.Pp
184To get a better idea what's going on, use the
185.Fl v
186flag:
187.Pp
188.Dl etcupdate -v
189.Sh HISTORY
190The
191.Nm
192command appeared in
193.Nx 1.6 .
194.Sh AUTHORS
195The
196script was written by Martti Kuparinen <martti@netbsd.org> and
197improved by several other
198.Nx
199users.
200.Pp
201The idea for this script (including code fragments, variable names etc.)
202came from the
203.Fx
204mergemaster (by Douglas Barton).  Unlike the
205.Fx
206mergemaster, this does not use CVS version tags to compare if
207the files need to be updated. Files are compared with
208.Xr cmp 1
209as this is more reliable and the only way if the version numbers are the
210same even though the files are different.
211