Make it more clear in the docs that -a is not compatible with -iFU,

and enforce this in the code. Apparently a lot of users mistakenly
combine -a with these flags and are then mystified that no changes
were made.

While I'm here, fix a trailing space in mergemaster.8
This commit is contained in:
Doug Barton 2010-03-14 05:22:46 +00:00
parent 2fe9b8d454
commit c9bb666937
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=205145
2 changed files with 22 additions and 7 deletions

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 7, 2010
.Dd March 13, 2010
.Dt MERGEMASTER 8
.Os
.Sh NAME
@ -32,7 +32,8 @@
.Nd merge configuration files, et al during an upgrade
.Sh SYNOPSIS
.Nm
.Op Fl scrvahipFCPU
.Op Fl scrvhpCP
.Op Fl a|iFU
.Op Fl m Ar /path/to/sources
.Op Fl t Ar /path/to/temp/root
.Op Fl d
@ -206,9 +207,11 @@ If the
directory exists, it creates a new one in a previously
non-existent directory.
This option unsets the verbose flag,
but other than
.Fl U
it is compatible with all other options.
and is not compatible with
.Fl i ,
.Fl F ,
or
.Fl U .
Setting
.Fl a
makes

View File

@ -15,7 +15,7 @@ PATH=/bin:/usr/bin:/usr/sbin
display_usage () {
VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
echo "mergemaster version ${VERSION_NUMBER}"
echo 'Usage: mergemaster [-scrvahipFCPU]'
echo 'Usage: mergemaster [-scrvhpCP] [-a|[-iFU]]'
echo ' [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]'
echo "Options:"
echo " -s Strict comparison (diff every pair of files)"
@ -337,6 +337,18 @@ while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do
esac
done
if [ -n "$AUTO_RUN" ]; then
if [ -n "$FREEBSD_ID" -o -n "$AUTO_UPGRADE" -o -n "$AUTO_INSTALL" ]; then
echo ''
echo "*** You have included the -a option along with one or more options"
echo ' that indicate that you wish mergemaster to actually make updates'
echo ' (-F, -U, or -i), however these options are not compatible.'
echo ' Please read mergemaster(8) for more information.'
echo ''
exit 1
fi
fi
# Assign the location of the mtree database
#
MTREEDB=${MTREEDB:-${DESTDIR}/var/db}