|ETCMERGE(1)||General Commands Manual||ETCMERGE(1)|
etcmergeutility assists merging updates to configuration files given the old and new upstream etc.tgz (or xetc.tgz) distribution sets.
$ etcmerge auto old/etc.tgz new/etc.tgz
etcmergewill leave F intact and create new files:
autoeditF will launch the editor on the .~merge~ file, and, if there are no conflict markers when it exits, move the .~merge~ file into place and delete the .~old~ and .~new~ files.
For an interactive three-way merge in a separate staging area, start by running:
$ etcmerge start old/etc.tgz new/etc.tgz
Once the merge is started, the various subcommands
resolved, and so on
display and edit state of the merge operation:
$ etcmerge show /etc/ssh/sshd_config $ etcmerge diff -l -u /etc/ssh/sshd_config $ etcmerge diff -n -u /etc/ssh/sshd_config $ etcmerge edit /etc/ssh/sshd_config $ etcmerge resolved /etc/ssh/sshd_config
When done, run either
commit to apply the changes outside the staging
give up on the merge and discard all changes.
Only one merge at a time can be in progress, unless you specify an
alternate state directory with
start will refuse
to start a new merge until an ongoing one is aborted or committed.
etcmergestate, instead of the default /var/etcmerge.
-Rrootdir] old.tgz new.tgz
-coption. You can use
autoeditto edit the .~merge~ files to resolve conflicts.
Note: This does not use a separate staging area.
auto is an
You should make sure to resolve all the conflicts (and delete
these extra files manually if you don't use
before the next update;
auto will refuse to overwrite an existing
.~old~, .~new~, or
.~merge~ file in order to avoid clobbering
>>>>>>>), then rename it to the permanent name without .~merge~ and delete the corresponding .~old~ and .~new~ files.
Meant for use after
auto; this does not use a separate staging
This moves all files from the staging area into their final
places in the file system (relative to any rootdir
start), and runs post-merge actions, including
MAKEDEV(8) if /dev/MAKEDEV or
/etc/master.passwd changed, and
/etc/services changed. (XXX The post-merge
actions are not yet implemented.)
-d option, delete files that
have been deleted upstream. (XXX This is not yet correctly implemented
— it doesn't track local versus upstream deletions.)
-clmnpru] [path ...]
-l (local) or
-n (new) must be specified to choose which
-m, diff from whichever version
is selected to the current file in the staging area. Without
-m, diff from the old (upstream) version to
whichever version is selected.
If the files have unresolved conflicts,
etcmerge will continue to consider them
unresolved; if you have resolved them, use
mark them as resolved.
Note: If the file still has merge conflict markers, then after
will remain in the file if committed with
runcommand [args ...]
-c option, ignore the current
state and instead display the automatic merge of the file, with conflict
-Rrootdir] old.tgz new.tgz
etcmergewill not create conflict markers, although it may yield nonsensical results if diff3(1) gets confused. This may be combined with the
-Coption to autocommit only if all upstream changes are to files unmodified locally.
-A, in the event of a successful merge, delete files that were deleted upstream. (XXX This is not yet correctly implemented — it doesn't track local versus upstream deletions.)
commitoperation. All files in the file system outside the staging area listed in old.tgz or new.tgz are restored to the state they were in before
There is only one level of undo.
undo is a
convenience, not a substitute for backups — make sure to keep
(XXX This doesn't do anything about deletions.)
etcmergeis new and likely buggy, and may find your files tasty with a bit of mustard. Take backups.
etcmergemust be run as root. It would be nice if it could run unprivileged and use mtree(1) to record permissions on files it handles, and create a tar archive for the resulting merge outcome.
|January 6, 2021||NetBSD 9.1_STABLE|