1 .\" Copyright (c) 1998-2000 Douglas Barton
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd Merge configuration files, et al during an upgrade
36 .Op Fl m Ar /path/to/sources
37 .Op Fl t Ar /path/to/temp/root
44 is a Bourne shell script which is designed to aid you
45 in updating the various configuration and other files
50 recommended that you back up your
52 directory before beginning this process.
55 .Pa /usr/src/etc/Makefile
56 to build a temporary root environment from
58 down, populating that environment with the various
60 You can specify a different source directory
63 command line option, or specify the destination
67 It then compares each file in that environment
68 to its installed counterpart.
69 When the script finds a
70 change in the new file, or there is no installed
71 version of the new file it gives you four options to
73 You can install the new file as is,
74 delete the new file, merge the old and new
75 files (as appropriate) using
77 or leave the file in the temporary root environment to
80 By default it creates the temporary root in
84 version $Id/$FreeBSD strings for files that have them, deleting
85 the temporary file if the strings match.
87 no $Id string, or if the strings are different it
88 compares the files themselves.
90 also specify that the script ignore the $Id strings and
94 checks your umask and issues a warning for anything
95 other than 022. While it is not mandatory to grant
96 world read permissions for most configuration files, you
97 may run into problems without them.
99 umask other than 022 and experience trouble later this
101 .Pa /etc/master.passwd
102 is treated as a special case.
103 If you choose to install
104 this file or a merged version of it the file permissions
105 are always 600 (rw-------) for security reasons.
107 installing an updated version of this file you should
110 with the -p option to rebuild your password databases
114 The script uses the owner and group id's
115 that the files are created with by
116 .Pa /usr/src/etc/Makefile ,
117 and file permissions as specified by the umask.
118 Unified diffs are used by default to display any
119 differences unless you choose context diffs.
122 will source scripts that you specify right before
123 it starts the comparison, and after it's done running.
124 The easiest way to handle this is to place the path
125 to the script(s) in the appropriate variables in your
128 The script sourced before comparison is named in
129 .Ev MM_PRE_COMPARE_SCRIPT ,
130 and the one sourced after the script is done is
132 This is the recommended way to specify local modifications,
133 or files that you want to give special handling to.
134 This includes files that you want to be deleted without
136 Because the named scripts are sourced from within
138 all of the script's variables are available for use in
141 The options are as follows:
144 Perform a strict comparison, diff'ing every pair of files.
146 Use context diffs instead of unified diffs.
150 on a previously cleaned directory, skipping the creation of
151 the temporary root environment.
152 This option is compatible
153 with all other options.
155 Be more verbose about the process.
156 You should probably use
157 this option the first time you run
159 This option also gives you a list of files that exist
160 only in the installed version of
164 This option will leave all the files that
165 differ from the installed versions in the temporary directory
166 to be dealt with by hand.
169 directory exists, it creates a new one in a previously
170 non-existent directory.
171 This option unsets the verbose flag,
172 but is compatible with all other options.
176 Display usage and help information.
178 Automatically install any files that do not exist in the
179 destination directory.
180 .It Fl m Ar /path/to/sources
181 Specify the path to the directory where you want to do the
183 (In other words, where your sources are, but -s was already
185 .It Fl t Ar /path/to/temp/root
186 Create the temporary root environment in
187 .Pa /path/to/temp/root
188 instead of the default
189 .Pa /var/tmp/temproot .
191 Add the date and time to the name of the temporary
193 If -t is specified, this option must
194 follow it if you want the date added too.
196 Specify a numeric umask.
199 Supply an alternate screen width to the
201 command in numbers of columns.
204 Specify the destination directory for the installed files.
211 environment variable if set.
216 specifies a program outside
220 without specifying the full path,
222 prompts you with options on how to proceed.
224 .Ev MM_PRE_COMPARE_SCRIPT
227 variables are used as described above.
228 Other variables that are used by the script internally
231 as described in more detail below.
233 Typically all you will need to do is type
235 at the prompt and the script will do all the work for you.
237 To use context diff's and have
239 explain more things as it goes along, use:
241 .Dl # mergemaster -cv
245 put the temporary root environment in
249 .Dl # mergemaster -t /usr/tmp/root
251 To specify a 110 column screen with a strict
254 .Dl # mergemaster -sw 110
257 .It Pa $HOME/.mergemasterrc
259 will . (source) this file if it exists.
261 will override rc file options.
263 with all values commented out:
266 # These are options for mergemaster, with their default values listed
267 # The following options have command line overrides
269 # Directory to install the temporary root environment into
270 #TEMPROOT='/var/tmp/temproot'
272 # Strict comparison bypasses the CVS $Id tests and compares every file
275 # Flag(s) to use for diff displayed when files differ
278 # Verbose mode includes more details and additional checks
281 # Automatically install files that do not exist on the system already
284 # Sourcedir is the directory to do the 'make' in (where the new files are)
285 #SOURCEDIR='/usr/src/etc'
287 # The umask for mergemaster to compare the default file's modes to
290 # Specify the destination directory for the installed files
293 # The following options have no command line overrides
294 # For those who just cannot stand including the full path to PAGER
297 # If you set 'yes' above, make sure to include the PATH to your pager
298 #PATH=/bin:/usr/bin:/usr/sbin
300 # Don't compare the old and new motd files
303 # Specify the path to scripts to run before the comparison starts,
304 # and/or after the script has finished its work
305 #MM_PRE_COMPARE_SCRIPT=
317 .Pa /usr/src/etc/Makefile
319 http://www.FreeBSD.org/handbook/makeworld.html ,
320 .Pa The Cutting Edge (using make world) ,
323 Exit status is 0 on successful completion, or if the user bails out
324 manually at some point during execution.
326 Exit status is 1 if it fails for one of the following reasons:
328 Invalid command line option
330 Failure to create the temporary root environment
332 Failure to populate the temporary root
337 script was first publicly available on one of my
338 web pages in a much simpler form under the name
340 on 13 March 1998. The idea for creating the
341 temporary root environment comes from Nik Clayton's
342 make world tutorial which is referenced above.
345 This manual page and the script itself were written by
346 .An Douglas Barton Aq DougB@FreeBSD.org .
348 There are no known bugs.
349 Please report any problems,
350 comments or suggestions to the author.
352 improvements to this program have come from user