2011-08-09 07:42:19 +00:00
|
|
|
.\" Copyright (c) 1998-2011 Douglas Barton
|
1999-10-20 07:22:52 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
|
|
|
.\"
|
1999-10-26 18:54:57 +00:00
|
|
|
.\" $FreeBSD$
|
1999-10-20 07:22:52 +00:00
|
|
|
.\"
|
2021-05-20 08:26:02 +00:00
|
|
|
.Dd May 20, 2021
|
1999-10-20 07:22:52 +00:00
|
|
|
.Dt MERGEMASTER 8
|
2001-07-10 15:12:08 +00:00
|
|
|
.Os
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm mergemaster
|
2001-04-18 15:54:10 +00:00
|
|
|
.Nd merge configuration files, et al during an upgrade
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2010-03-14 05:22:46 +00:00
|
|
|
.Op Fl scrvhpCP
|
|
|
|
.Op Fl a|iFU
|
1. Add a new option, --run-updates, to always or never run the newalises,
pwd_mkdb, etc. updates at the end of the comparison.
2. Add an update to the end to handle /etc/localtime, if it exists.
If /var/db/zoneinfo exists, automatically update /etc/localtime,
which should (hopefully) be safe to do. If not, prompt the user
to run tzsetup.
3. Update run_it_now(), the function that handles input for the updates,
to make sure that we got a valid answer, and to handle the --run-updates
option if supplied.
2011-11-02 07:40:23 +00:00
|
|
|
.Op Fl -run-updates=[always|never]
|
1999-10-20 07:22:52 +00:00
|
|
|
.Op Fl m Ar /path/to/sources
|
|
|
|
.Op Fl t Ar /path/to/temp/root
|
|
|
|
.Op Fl d
|
|
|
|
.Op Fl u Ar N
|
|
|
|
.Op Fl w Ar N
|
2009-03-18 21:55:08 +00:00
|
|
|
.Op Fl A Ar Target architecture
|
|
|
|
.Op Fl D Ar /destdir/path
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1999-10-20 07:22:52 +00:00
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility is a Bourne shell script which is designed to aid you
|
1999-10-20 07:22:52 +00:00
|
|
|
in updating the various configuration and other files
|
2000-11-14 11:20:58 +00:00
|
|
|
associated with
|
|
|
|
.Fx .
|
1999-10-20 07:22:52 +00:00
|
|
|
It is
|
|
|
|
.Sy HIGHLY
|
|
|
|
recommended that you back up your
|
|
|
|
.Pa /etc
|
|
|
|
directory before beginning this process.
|
|
|
|
.Pp
|
|
|
|
The script uses
|
2009-01-01 12:09:57 +00:00
|
|
|
.Pa /usr/src/Makefile
|
1999-10-20 07:22:52 +00:00
|
|
|
to build a temporary root environment from
|
|
|
|
.Pa /
|
|
|
|
down, populating that environment with the various
|
2000-03-01 14:09:25 +00:00
|
|
|
files.
|
|
|
|
You can specify a different source directory
|
1999-10-20 07:22:52 +00:00
|
|
|
with the
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl m
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
command line option, or specify the destination
|
|
|
|
directory with the
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl D
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
option.
|
1999-10-20 07:22:52 +00:00
|
|
|
It then compares each file in that environment
|
2000-03-01 14:09:25 +00:00
|
|
|
to its installed counterpart.
|
|
|
|
When the script finds a
|
1999-10-20 07:22:52 +00:00
|
|
|
change in the new file, or there is no installed
|
|
|
|
version of the new file it gives you four options to
|
2000-03-01 14:09:25 +00:00
|
|
|
deal with it.
|
|
|
|
You can install the new file as is,
|
1999-10-20 07:22:52 +00:00
|
|
|
delete the new file, merge the old and new
|
|
|
|
files (as appropriate) using
|
|
|
|
.Xr sdiff 1
|
|
|
|
or leave the file in the temporary root environment to
|
|
|
|
merge by hand later.
|
|
|
|
.Pp
|
|
|
|
By default it creates the temporary root in
|
|
|
|
.Pa /var/tmp/temproot
|
|
|
|
and compares the
|
2009-03-23 14:42:41 +00:00
|
|
|
Version Control System (VCS) Id strings ($FreeBSD)
|
2009-03-18 21:55:08 +00:00
|
|
|
for files that have them, deleting
|
2000-03-01 14:09:25 +00:00
|
|
|
the temporary file if the strings match.
|
|
|
|
If there is
|
2009-03-18 21:55:08 +00:00
|
|
|
no Id string, or if the strings are different it
|
2000-03-01 14:09:25 +00:00
|
|
|
compares the files themselves.
|
|
|
|
You can
|
2009-03-18 21:55:08 +00:00
|
|
|
also specify that the script ignore the Id strings and
|
|
|
|
compare every file with the
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl s
|
2009-03-18 21:55:08 +00:00
|
|
|
option.
|
|
|
|
Using the
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl F
|
2009-03-18 21:55:08 +00:00
|
|
|
option
|
|
|
|
.Nm
|
|
|
|
will install the new file for you if they differ only by
|
|
|
|
VCS strings.
|
1999-10-20 07:22:52 +00:00
|
|
|
.Pp
|
2003-05-02 06:28:30 +00:00
|
|
|
The merge menu option is designed to let you easily combine your
|
|
|
|
customizations from the old version of a file into the new one.
|
|
|
|
While you can use the merge function to incorporate changes from
|
|
|
|
files that you have not customized,
|
|
|
|
it is not recommended.
|
|
|
|
.Pp
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1999-10-20 07:22:52 +00:00
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility checks your umask and issues a warning for anything
|
2004-07-02 23:13:00 +00:00
|
|
|
other than 022.
|
|
|
|
While it is not mandatory to grant
|
1999-10-20 07:22:52 +00:00
|
|
|
world read permissions for most configuration files, you
|
2000-03-01 14:09:25 +00:00
|
|
|
may run into problems without them.
|
|
|
|
If you choose a
|
1999-10-20 07:22:52 +00:00
|
|
|
umask other than 022 and experience trouble later this
|
|
|
|
could be the cause.
|
|
|
|
.Pa /etc/master.passwd
|
2000-03-01 14:09:25 +00:00
|
|
|
is treated as a special case.
|
|
|
|
If you choose to install
|
1999-10-20 07:22:52 +00:00
|
|
|
this file or a merged version of it the file permissions
|
2000-03-01 14:09:25 +00:00
|
|
|
are always 600 (rw-------) for security reasons.
|
|
|
|
After
|
1999-10-20 07:22:52 +00:00
|
|
|
installing an updated version of this file you should
|
|
|
|
probably run
|
|
|
|
.Xr pwd_mkdb 8
|
2009-03-18 21:55:08 +00:00
|
|
|
with the
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl p
|
2009-03-18 21:55:08 +00:00
|
|
|
option to rebuild your password databases
|
1999-10-20 07:22:52 +00:00
|
|
|
and recreate
|
|
|
|
.Pa /etc/passwd .
|
|
|
|
.Pp
|
2009-03-18 21:55:08 +00:00
|
|
|
The script uses the owner and group ids
|
1999-10-20 07:22:52 +00:00
|
|
|
that the files are created with by
|
|
|
|
.Pa /usr/src/etc/Makefile ,
|
|
|
|
and file permissions as specified by the umask.
|
|
|
|
Unified diffs are used by default to display any
|
|
|
|
differences unless you choose context diffs.
|
|
|
|
.Pp
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility will source scripts that you specify right before
|
2005-02-13 23:45:54 +00:00
|
|
|
it starts the comparison, and after it is done running.
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
The easiest way to handle this is to place the path
|
|
|
|
to the script(s) in the appropriate variables in your
|
|
|
|
.Pa .mergemasterrc
|
|
|
|
file.
|
|
|
|
The script sourced before comparison is named in
|
|
|
|
.Ev MM_PRE_COMPARE_SCRIPT ,
|
|
|
|
and the one sourced after the script is done is
|
|
|
|
.Ev MM_EXIT_SCRIPT .
|
|
|
|
This is the recommended way to specify local modifications,
|
|
|
|
or files that you want to give special handling to.
|
|
|
|
This includes files that you want to be deleted without
|
|
|
|
being compared.
|
|
|
|
Because the named scripts are sourced from within
|
|
|
|
.Nm ,
|
|
|
|
all of the script's variables are available for use in
|
|
|
|
your custom script.
|
2001-03-05 10:13:21 +00:00
|
|
|
You can also use
|
|
|
|
.Pa /etc/mergemaster.rc
|
|
|
|
which will be read before
|
|
|
|
.Pa .mergemasterrc .
|
|
|
|
Options specified on the command line are updated last,
|
|
|
|
and therefore can override both files.
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
.Pp
|
2010-01-08 00:05:10 +00:00
|
|
|
When the comparison is done if there are any files remaining
|
|
|
|
in the temproot directory they will be listed, and if the
|
|
|
|
.Fl a
|
2010-03-14 05:22:46 +00:00
|
|
|
option is not in use the user will be given the option of
|
2010-01-08 00:05:10 +00:00
|
|
|
deleting the temproot directory.
|
|
|
|
If there are no files remaining in the temproot directory
|
|
|
|
it will be deleted.
|
|
|
|
.Pp
|
1999-10-20 07:22:52 +00:00
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width Fl
|
|
|
|
.It Fl s
|
2009-03-18 21:55:08 +00:00
|
|
|
Perform a strict comparison, diffing every pair of files.
|
2002-02-12 09:50:16 +00:00
|
|
|
This comparison is performed line by line,
|
2009-03-18 21:55:08 +00:00
|
|
|
without regard to VCS Ids.
|
1999-10-20 07:22:52 +00:00
|
|
|
.It Fl c
|
|
|
|
Use context diffs instead of unified diffs.
|
|
|
|
.It Fl r
|
|
|
|
Re-run
|
|
|
|
.Nm
|
|
|
|
on a previously cleaned directory, skipping the creation of
|
2000-03-01 14:09:25 +00:00
|
|
|
the temporary root environment.
|
|
|
|
This option is compatible
|
1999-10-20 07:22:52 +00:00
|
|
|
with all other options.
|
|
|
|
.It Fl v
|
2000-03-01 14:09:25 +00:00
|
|
|
Be more verbose about the process.
|
|
|
|
You should probably use
|
1999-10-20 07:22:52 +00:00
|
|
|
this option the first time you run
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm .
|
1999-10-20 07:22:52 +00:00
|
|
|
This option also gives you a list of files that exist
|
|
|
|
only in the installed version of
|
|
|
|
.Pa /etc .
|
|
|
|
.It Fl a
|
2000-03-01 14:09:25 +00:00
|
|
|
Run automatically.
|
|
|
|
This option will leave all the files that
|
1999-10-20 07:22:52 +00:00
|
|
|
differ from the installed versions in the temporary directory
|
2000-03-01 14:09:25 +00:00
|
|
|
to be dealt with by hand.
|
|
|
|
If the
|
1999-10-20 07:22:52 +00:00
|
|
|
.Pa temproot
|
|
|
|
directory exists, it creates a new one in a previously
|
2000-03-01 14:09:25 +00:00
|
|
|
non-existent directory.
|
|
|
|
This option unsets the verbose flag,
|
2010-03-14 05:22:46 +00:00
|
|
|
and is not compatible with
|
|
|
|
.Fl i ,
|
|
|
|
.Fl F ,
|
|
|
|
or
|
|
|
|
.Fl U .
|
2009-03-18 21:55:08 +00:00
|
|
|
Setting
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl a
|
2009-03-18 21:55:08 +00:00
|
|
|
makes
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl w
|
2009-03-18 21:55:08 +00:00
|
|
|
superfluous.
|
1999-10-20 07:22:52 +00:00
|
|
|
.It Fl h
|
|
|
|
Display usage and help information.
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
.It Fl i
|
|
|
|
Automatically install any files that do not exist in the
|
|
|
|
destination directory.
|
2002-04-08 09:49:40 +00:00
|
|
|
.It Fl p
|
|
|
|
Pre-buildworld mode.
|
2002-05-04 22:53:03 +00:00
|
|
|
Compares only files known to be essential to the success of
|
2017-03-07 04:13:22 +00:00
|
|
|
{build|install}world, i.e.,
|
|
|
|
.Pa /etc/group
|
|
|
|
and
|
|
|
|
.Pa /etc/master.passwd .
|
2009-03-18 21:55:08 +00:00
|
|
|
.It Fl F
|
2009-03-23 14:42:41 +00:00
|
|
|
If the files differ only by VCS Id ($FreeBSD)
|
2009-03-18 21:55:08 +00:00
|
|
|
install the new file.
|
2002-04-08 09:49:40 +00:00
|
|
|
.It Fl C
|
|
|
|
After a standard
|
|
|
|
.Nm
|
|
|
|
run,
|
|
|
|
compares your rc.conf[.local] options to the defaults.
|
2003-05-02 06:28:30 +00:00
|
|
|
.It Fl P
|
|
|
|
Preserve files that you replace in
|
|
|
|
.Pa /var/tmp/mergemaster/preserved-files-<date> ,
|
|
|
|
or another directory you specify in your
|
|
|
|
.Nm
|
|
|
|
rc file.
|
2009-03-18 21:55:08 +00:00
|
|
|
.It Fl U
|
|
|
|
Attempt to auto upgrade files that have not been user modified.
|
2011-08-09 07:42:19 +00:00
|
|
|
This option can be dangerous when there are critical changes
|
|
|
|
in the new versions that affect your running system.
|
1. Add a new option, --run-updates, to always or never run the newalises,
pwd_mkdb, etc. updates at the end of the comparison.
2. Add an update to the end to handle /etc/localtime, if it exists.
If /var/db/zoneinfo exists, automatically update /etc/localtime,
which should (hopefully) be safe to do. If not, prompt the user
to run tzsetup.
3. Update run_it_now(), the function that handles input for the updates,
to make sure that we got a valid answer, and to handle the --run-updates
option if supplied.
2011-11-02 07:40:23 +00:00
|
|
|
.It Fl -run-updates=[always|never]
|
|
|
|
Specify always or never to run newaliases, pwd_mkdb, etc.
|
|
|
|
at the end of the comparison run.
|
|
|
|
If this option is omitted the default is to prompt the user
|
|
|
|
for each update as necessary.
|
1999-10-20 07:22:52 +00:00
|
|
|
.It Fl m Ar /path/to/sources
|
|
|
|
Specify the path to the directory where you want to do the
|
|
|
|
.Xr make 1 .
|
|
|
|
(In other words, where your sources are, but -s was already
|
|
|
|
taken.)
|
2015-09-29 17:54:01 +00:00
|
|
|
In older versions of
|
2009-01-02 22:24:12 +00:00
|
|
|
.Nm
|
2015-09-29 17:54:01 +00:00
|
|
|
the path to
|
|
|
|
.Pa src/etc
|
|
|
|
was required.
|
2009-01-02 22:24:12 +00:00
|
|
|
.Nm
|
2015-09-29 17:54:01 +00:00
|
|
|
will convert the path if this older method is used.
|
1999-10-20 07:22:52 +00:00
|
|
|
.It Fl t Ar /path/to/temp/root
|
|
|
|
Create the temporary root environment in
|
|
|
|
.Pa /path/to/temp/root
|
|
|
|
instead of the default
|
|
|
|
.Pa /var/tmp/temproot .
|
|
|
|
.It Fl d
|
|
|
|
Add the date and time to the name of the temporary
|
2000-03-01 14:09:25 +00:00
|
|
|
root directory.
|
2009-03-18 21:55:08 +00:00
|
|
|
If
|
2009-12-30 23:26:29 +00:00
|
|
|
.Fl t
|
2009-03-18 21:55:08 +00:00
|
|
|
is specified, this option must
|
1999-10-20 07:22:52 +00:00
|
|
|
follow it if you want the date added too.
|
|
|
|
.It Fl u Ar N
|
2000-03-01 14:09:25 +00:00
|
|
|
Specify a numeric umask.
|
|
|
|
The default is 022.
|
1999-10-20 07:22:52 +00:00
|
|
|
.It Fl w Ar N
|
|
|
|
Supply an alternate screen width to the
|
|
|
|
.Xr sdiff 1
|
2000-03-01 14:09:25 +00:00
|
|
|
command in numbers of columns.
|
|
|
|
The default is 80.
|
2009-01-01 12:09:57 +00:00
|
|
|
.It Fl A Ar Target architecture
|
2006-02-04 18:24:06 +00:00
|
|
|
Specify an alternative
|
|
|
|
.Ev TARGET_ARCH
|
|
|
|
architecture name.
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
.It Fl D Ar /path
|
|
|
|
Specify the destination directory for the installed files.
|
1999-10-20 07:22:52 +00:00
|
|
|
.El
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
The
|
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility uses the
|
1999-10-20 07:22:52 +00:00
|
|
|
.Ev PAGER
|
2000-03-01 14:09:25 +00:00
|
|
|
environment variable if set.
|
|
|
|
Otherwise it uses
|
2018-08-08 19:24:20 +00:00
|
|
|
.Xr less 1 .
|
1999-10-20 07:22:52 +00:00
|
|
|
If
|
|
|
|
.Ev PAGER
|
|
|
|
specifies a program outside
|
|
|
|
its
|
|
|
|
limited
|
|
|
|
.Ev PATH
|
|
|
|
without specifying the full path,
|
|
|
|
.Nm
|
|
|
|
prompts you with options on how to proceed.
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
The
|
|
|
|
.Ev MM_PRE_COMPARE_SCRIPT
|
|
|
|
and
|
|
|
|
.Ev MM_EXIT_SCRIPT
|
|
|
|
variables are used as described above.
|
|
|
|
Other variables that are used by the script internally
|
|
|
|
can be specified in
|
|
|
|
.Pa .mergemasterrc
|
|
|
|
as described in more detail below.
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh FILES
|
2001-07-05 09:35:20 +00:00
|
|
|
.Bl -tag -width $HOME/.mergemasterrc -compact
|
2001-05-28 13:10:16 +00:00
|
|
|
.It Pa /etc/mergemaster.rc
|
2000-12-27 15:30:30 +00:00
|
|
|
.It Pa $HOME/.mergemasterrc
|
2001-07-05 09:35:20 +00:00
|
|
|
.El
|
2001-05-28 13:10:16 +00:00
|
|
|
.Pp
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1999-10-20 07:22:52 +00:00
|
|
|
.Nm
|
2004-07-02 23:13:00 +00:00
|
|
|
utility will
|
|
|
|
.Ic .\&
|
|
|
|
(source) these files if they exist.
|
2000-03-01 14:09:25 +00:00
|
|
|
Command line options
|
|
|
|
will override rc file options.
|
2001-05-28 13:10:16 +00:00
|
|
|
.Pa $HOME/.mergemasterrc
|
|
|
|
overrides
|
|
|
|
.Pa /etc/mergemaster.rc .
|
2000-03-01 14:09:25 +00:00
|
|
|
Here is an example
|
1999-10-20 07:22:52 +00:00
|
|
|
with all values commented out:
|
|
|
|
.Bd -literal
|
|
|
|
# These are options for mergemaster, with their default values listed
|
|
|
|
# The following options have command line overrides
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# The target architecture (-A, unset by default)
|
2009-01-01 12:09:57 +00:00
|
|
|
#ARCHSTRING='TARGET_ARCH=<foo>'
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Sourcedir is the directory to do the 'make' in (-m)
|
2009-01-01 12:09:57 +00:00
|
|
|
#SOURCEDIR='/usr/src'
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Directory to install the temporary root environment into (-t)
|
1999-10-20 07:22:52 +00:00
|
|
|
#TEMPROOT='/var/tmp/temproot'
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Specify the destination directory for the installed files (-D)
|
2009-01-01 12:09:57 +00:00
|
|
|
#DESTDIR=
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Strict comparison skips the VCS Id test and compares every file (-s)
|
1999-10-20 07:22:52 +00:00
|
|
|
#STRICT=no
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Type of diff, such as unified, context, etc. (-c)
|
1999-10-20 07:22:52 +00:00
|
|
|
#DIFF_FLAG='-u'
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Install the new file if it differs only by VCS Id ($FreeBSD, -F)
|
2009-03-18 21:55:08 +00:00
|
|
|
#FREEBSD_ID=
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Verbose mode includes more details and additional checks (-v)
|
1999-10-20 07:22:52 +00:00
|
|
|
#VERBOSE=
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Automatically install files that do not exist on the system already (-i)
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
#AUTO_INSTALL=
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Automatically upgrade files that have not been user modified (-U)
|
2011-08-09 07:42:19 +00:00
|
|
|
# ***DANGEROUS***
|
2008-06-11 18:54:06 +00:00
|
|
|
#AUTO_UPGRADE=
|
|
|
|
#
|
1. Add a new option, --run-updates, to always or never run the newalises,
pwd_mkdb, etc. updates at the end of the comparison.
2. Add an update to the end to handle /etc/localtime, if it exists.
If /var/db/zoneinfo exists, automatically update /etc/localtime,
which should (hopefully) be safe to do. If not, prompt the user
to run tzsetup.
3. Update run_it_now(), the function that handles input for the updates,
to make sure that we got a valid answer, and to handle the --run-updates
option if supplied.
2011-11-02 07:40:23 +00:00
|
|
|
# Either always or never run newaliases, pwd_mkdb at the end (--run-updates)
|
|
|
|
#RUN_UPDATES=
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C)
|
|
|
|
#COMP_CONFS=
|
2002-05-04 22:53:03 +00:00
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Preserve files that you replace (-P)
|
|
|
|
#PRESERVE_FILES=
|
2003-05-02 06:28:30 +00:00
|
|
|
#PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S`
|
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# The umask for mergemaster to compare the default file's modes to (-u)
|
1999-10-20 07:22:52 +00:00
|
|
|
#NEW_UMASK=022
|
|
|
|
#
|
|
|
|
# The following options have no command line overrides
|
2009-01-01 12:09:57 +00:00
|
|
|
#
|
|
|
|
# Files to always avoid comparing
|
|
|
|
#IGNORE_FILES='/etc/motd /etc/printcap foo bar'
|
|
|
|
#
|
|
|
|
# Additional options for diff. This will get unset when using -s.
|
2009-03-18 21:55:08 +00:00
|
|
|
#DIFF_OPTIONS='-Bb' # Ignore changes in whitespace
|
2009-01-01 12:09:57 +00:00
|
|
|
#
|
|
|
|
# Location to store the list of mtree values for AUTO_UPGRADE purposes
|
|
|
|
#MTREEDB='/var/db'
|
|
|
|
#
|
1999-10-20 07:22:52 +00:00
|
|
|
# For those who just cannot stand including the full path to PAGER
|
|
|
|
#DONT_CHECK_PAGER=
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
#
|
1999-10-20 07:22:52 +00:00
|
|
|
# If you set 'yes' above, make sure to include the PATH to your pager
|
2000-11-09 00:19:21 +00:00
|
|
|
#PATH=/bin:/usr/bin:/usr/sbin
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
#
|
2009-12-30 23:16:14 +00:00
|
|
|
# Delete stale files in /etc/rc.d without prompting
|
|
|
|
#DELETE_STALE_RC_FILES=
|
|
|
|
#
|
Add several new features, reorder some code, and continue with the
process of making the script more cross platform friendly.
* Add -i option to automatically install files that do not exist
on the system already.
* Add the ability to specify DESTDIR.
* Allow the user to specify scripts to run right before the
comparison starts, and when mm is done. This will
allow the user to specify customized local behavior, and
implement features such as automatically deleting files.
* Document the above changes in the man page.
* Switch to using 'ident' for the CVS Id comparison, which
should help with portability, and makes it faster.
* Reorder, and in one case fix some code by doing things in
ways that make more sense.
* Check to see if the file exists on the system before doing
the comparisons. This saves CPU cycles, and streamlines
the auto-install process.
I used bits and pieces of suggestions and patches from various
people, ultimately too numerous to name. Which is not to say
that they were not both appreciated, and helpful in achieving
the ultimate result.
2000-10-30 10:33:51 +00:00
|
|
|
# Specify the path to scripts to run before the comparison starts,
|
|
|
|
# and/or after the script has finished its work
|
|
|
|
#MM_PRE_COMPARE_SCRIPT=
|
|
|
|
#MM_EXIT_SCRIPT=
|
1999-10-20 07:22:52 +00:00
|
|
|
.Ed
|
2005-01-18 20:02:45 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
Exit status is 0 on successful completion, or if the user bails out
|
|
|
|
manually at some point during execution.
|
|
|
|
.Pp
|
|
|
|
Exit status is 1 if it fails for one of the following reasons:
|
|
|
|
.Pp
|
|
|
|
Invalid command line option
|
|
|
|
.Pp
|
|
|
|
Failure to create the temporary root environment
|
|
|
|
.Pp
|
|
|
|
Failure to populate the temporary root
|
2009-01-01 12:09:57 +00:00
|
|
|
.Pp
|
|
|
|
Presence of the 'nodev' option in
|
|
|
|
.Pa <DESTDIR>/etc/fstab
|
|
|
|
.Pp
|
|
|
|
Failure to install a file
|
2005-01-18 20:02:45 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
Typically all you will need to do is type
|
|
|
|
.Nm
|
|
|
|
at the prompt and the script will do all the work for you.
|
|
|
|
.Pp
|
2009-03-18 21:55:08 +00:00
|
|
|
To use context diffs and have
|
2005-01-18 20:02:45 +00:00
|
|
|
.Nm
|
|
|
|
explain more things as it goes along, use:
|
|
|
|
.Pp
|
|
|
|
.Dl # mergemaster -cv
|
|
|
|
.Pp
|
|
|
|
To specify that
|
|
|
|
.Nm
|
|
|
|
put the temporary root environment in
|
|
|
|
.Pa /usr/tmp/root ,
|
|
|
|
use:
|
|
|
|
.Pp
|
|
|
|
.Dl # mergemaster -t /usr/tmp/root
|
|
|
|
.Pp
|
|
|
|
To specify a 110 column screen with a strict
|
|
|
|
comparison, use:
|
|
|
|
.Pp
|
|
|
|
.Dl # mergemaster -sw 110
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr diff 1 ,
|
|
|
|
.Xr make 1 ,
|
2018-08-08 19:24:20 +00:00
|
|
|
.Xr less 1 ,
|
1999-10-20 07:22:52 +00:00
|
|
|
.Xr sdiff 1 ,
|
2018-11-27 10:31:29 +00:00
|
|
|
.Xr etcupdate 8 ,
|
1999-10-20 07:22:52 +00:00
|
|
|
.Xr pwd_mkdb 8
|
|
|
|
.Pp
|
|
|
|
.Pa /usr/src/etc/Makefile
|
2001-07-05 09:35:20 +00:00
|
|
|
.Rs
|
2021-05-20 08:26:02 +00:00
|
|
|
.%U https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld
|
|
|
|
.%T The FreeBSD Handbook
|
2001-07-05 09:35:20 +00:00
|
|
|
.Re
|
1999-10-20 07:22:52 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility was first publicly available on one of my
|
1999-10-20 07:22:52 +00:00
|
|
|
web pages in a much simpler form under the name
|
|
|
|
.Pa comproot
|
2004-07-02 23:13:00 +00:00
|
|
|
on 13 March 1998.
|
|
|
|
The idea for creating the
|
1999-10-20 07:22:52 +00:00
|
|
|
temporary root environment comes from Nik Clayton's
|
|
|
|
make world tutorial which is referenced above.
|
2000-11-17 11:44:16 +00:00
|
|
|
.Sh AUTHORS
|
1999-10-20 07:22:52 +00:00
|
|
|
This manual page and the script itself were written by
|
2014-06-20 09:57:27 +00:00
|
|
|
.An Douglas Barton Aq Mt dougb@FreeBSD.org .
|