From owner-freebsd-current@FreeBSD.ORG Wed Jun 11 14:18:22 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B7A6106566B for ; Wed, 11 Jun 2008 14:18:22 +0000 (UTC) (envelope-from mtm@wubethiopia.com) Received: from dire.wubethiopia.com (j071.v.rootbsd.net [208.79.82.223]) by mx1.freebsd.org (Postfix) with ESMTP id D3EF38FC1F for ; Wed, 11 Jun 2008 14:18:21 +0000 (UTC) (envelope-from mtm@wubethiopia.com) Received: from rogue.mike.lan (unknown [213.55.87.92]) by dire.wubethiopia.com (Postfix) with ESMTPSA id 6FE1A4FD966E; Wed, 11 Jun 2008 14:01:57 +0000 (UTC) Message-ID: <484FDC12.3010407@wubethiopia.com> Date: Wed, 11 Jun 2008 17:07:14 +0300 From: Mike Makonnen User-Agent: Thunderbird 2.0.0.12 (X11/20080323) MIME-Version: 1.0 To: Doug Barton Content-Type: multipart/mixed; boundary="------------090804020003050306010800" Cc: freebsd-current@freebsd.org, freebsd-rc@freebsd.org Subject: Making -i and -U default behavior for mergemaster (was: Re: svn commit: r179669 - head/sbin/rcorder) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 14:18:22 -0000 This is a multi-part message in MIME format. --------------090804020003050306010800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------090804020003050306010800 Content-Type: text/plain; name="mergemaster-auto-install-upgrade.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mergemaster-auto-install-upgrade.patch" 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- , @@ -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 --------------090804020003050306010800--