Making -i and -U default behavior for mergemaster (was: Re: svn
commit: r179669 - head/sbin/rcorder)
Mike Makonnen
mtm at wubethiopia.com
Wed Jun 11 14:02:04 UTC 2008
Hi Doug,
The -i and -U options to mergemaster are such timesavers that I was
wondering if they shouldn't be turned on by default. The attached patch
makes this the default behavior and uses the -I and -X command line
switches to turn it off.
Cheers.
--
Mike Makonnen | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc
mtm @ FreeBSD.Org | AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55
FreeBSD | http://www.freebsd.org
-------------- next part --------------
Index: usr.sbin/mergemaster/mergemaster.8
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.8,v
retrieving revision 1.36
diff -u -r1.36 mergemaster.8
--- usr.sbin/mergemaster/mergemaster.8 30 Apr 2006 22:09:47 -0000 1.36
+++ usr.sbin/mergemaster/mergemaster.8 11 Jun 2008 13:34:28 -0000
@@ -32,7 +32,7 @@
.Nd merge configuration files, et al during an upgrade
.Sh SYNOPSIS
.Nm
-.Op Fl scrvahipCPU
+.Op Fl scrvahpCIPX
.Op Fl m Ar /path/to/sources
.Op Fl t Ar /path/to/temp/root
.Op Fl d
@@ -193,9 +193,6 @@
-w superfluous.
.It Fl h
Display usage and help information.
-.It Fl i
-Automatically install any files that do not exist in the
-destination directory.
.It Fl p
Pre-buildworld mode.
Compares only files known to be essential to the success of
@@ -207,6 +204,9 @@
.Nm
run,
compares your rc.conf[.local] options to the defaults.
+.It Fl i
+Prompt the user to manually install any files that do not exist in the
+destination directory.
.It Fl P
Preserve files that you replace in
.Pa /var/tmp/mergemaster/preserved-files-<date> ,
@@ -243,7 +243,7 @@
.It Fl D Ar /path
Specify the destination directory for the installed files.
.It Fl U
-Attempt to auto upgrade files that have not been user modified.
+Prompt the user to upgrade files that have not been user modified.
.El
.Sh ENVIRONMENT
The
Index: usr.sbin/mergemaster/mergemaster.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v
retrieving revision 1.56
diff -u -r1.56 mergemaster.sh
--- usr.sbin/mergemaster/mergemaster.sh 26 May 2008 10:40:09 -0000 1.56
+++ usr.sbin/mergemaster/mergemaster.sh 11 Jun 2008 13:53:29 -0000
@@ -24,7 +24,6 @@
echo " -v Be more verbose about the process, include additional checks"
echo " -a Leave all files that differ to merge by hand"
echo " -h Display more complete help"
- echo ' -i Automatically install files that do not exist in destination directory'
echo ' -p Pre-buildworld mode, only compares crucial files'
echo ' -C Compare local rc.conf variables to the defaults'
echo ' -P Preserve files that are overwritten'
@@ -35,7 +34,8 @@
echo " -w N Specify a screen width in columns to sdiff"
echo " -A architecture Alternative architecture name to pass to make"
echo ' -D /path/directory Specify the destination directory to install files to'
- echo " -U Attempt to auto upgrade files that have not been user modified."
+ echo ' -I Prompt the user to install files that do not exist in destination directory'
+ echo " -X Prompt the user to upgrade files that have not been user modified."
echo ''
}
@@ -260,15 +260,20 @@
. "$HOME/.mergemasterrc"
fi
+# Set default options
+#
+AUTO_UPGRADE=yes
+AUTO_INSTALL=yes
+
# Check the command line options
#
-while getopts ":ascrvhipCPm:t:du:w:D:A:U" COMMAND_LINE_ARGUMENT ; do
+while getopts ":ascrvhipCIPXm:t:du:w:D:A:U" COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
A)
ARCHSTRING='MACHINE_ARCH='${OPTARG}
;;
- U)
- AUTO_UPGRADE=yes
+ X)
+ unset AUTO_UPGRADE
;;
s)
STRICT=yes
@@ -294,8 +299,8 @@
display_help
exit 0
;;
- i)
- AUTO_INSTALL=yes
+ I)
+ unset AUTO_INSTALL
;;
C)
COMP_CONFS=yes
@@ -1028,15 +1033,15 @@
'')
(
echo ''
- echo '*** You chose the automatic install option for files that did not'
- echo ' exist on your system. The following were installed for you:'
+ echo '*** The following files did not exist on your system. They were'
+ echo ' automatically installed for you:'
echo "${AUTO_INSTALLED_FILES}"
) | ${PAGER}
;;
*)
echo ''
- echo '*** You chose the automatic install option for files that did not'
- echo ' exist on your system. The following were installed for you:'
+ echo '*** The following files did not exist on your system. They were'
+ echo ' automatically installed for you:'
echo "${AUTO_INSTALLED_FILES}"
;;
esac
@@ -1050,15 +1055,15 @@
'')
(
echo ''
- echo '*** You chose the automatic upgrade option for files that you did'
- echo ' not alter on your system. The following were upgraded for you:'
+ echo '*** The following files were automatically upgraded for you'
+ echo ' because they contained no local modifications:'
echo "${AUTO_UPGRADED_FILES}"
) | ${PAGER}
;;
*)
echo ''
- echo '*** You chose the automatic upgrade option for files that you did'
- echo ' not alter on your system. The following were upgraded for you:'
+ echo '*** The following files were automatically upgraded for you'
+ echo ' because they contained no local modifications:'
echo "${AUTO_UPGRADED_FILES}"
;;
esac
More information about the freebsd-rc
mailing list