Index: mergemaster.8 =================================================================== RCS file: /mnt/space/cvsroot/src/usr.sbin/mergemaster/mergemaster.8,v retrieving revision 1.41 diff -u -r1.41 mergemaster.8 --- mergemaster.8 23 Mar 2009 14:42:41 -0000 1.41 +++ mergemaster.8 10 May 2009 08:18:32 -0000 @@ -32,7 +32,7 @@ .Nd merge configuration files, et al during an upgrade .Sh SYNOPSIS .Nm -.Op Fl scrvahipFCPU +.Op Fl scrvahiIpFCPU .Op Fl m Ar /path/to/sources .Op Fl t Ar /path/to/temp/root .Op Fl d @@ -209,6 +209,9 @@ .It Fl i Automatically install any files that do not exist in the destination directory. +.It Fl I +Automatically install any files that do not exist in the +destination directory, but proceed on failure. .It Fl p Pre-buildworld mode. Compares only files known to be essential to the success of Index: mergemaster.sh =================================================================== RCS file: /mnt/space/cvsroot/src/usr.sbin/mergemaster/mergemaster.sh,v retrieving revision 1.69 diff -u -r1.69 mergemaster.sh --- mergemaster.sh 23 Mar 2009 14:42:41 -0000 1.69 +++ mergemaster.sh 10 May 2009 11:16:39 -0000 @@ -15,7 +15,7 @@ display_usage () { VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` echo "mergemaster version ${VERSION_NUMBER}" - echo 'Usage: mergemaster [-scrvahipFCPU]' + echo 'Usage: mergemaster [-scrvahiIpFCPU]' 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)" @@ -25,6 +25,7 @@ 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 ' -I Automatically install files that do not exist in destination directory, but proceed on failure' echo ' -p Pre-buildworld mode, only compares crucial files' echo ' -F Install files that differ only by revision control Id ($FreeBSD)' echo ' -C Compare local rc.conf variables to the defaults' @@ -265,7 +266,7 @@ # Check the command line options # -while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do +while getopts ":ascrvhiIpCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in A) ARCHSTRING='TARGET_ARCH='${OPTARG} @@ -303,6 +304,10 @@ i) AUTO_INSTALL=yes ;; + I) + AUTO_INSTALL=yes + AUTO_INSTALL_FAILSAFE=yes + ;; C) COMP_CONFS=yes ;; @@ -763,9 +768,17 @@ # Create directories as needed # install_error () { - echo "*** FATAL ERROR: Unable to install ${1} to ${2}" - echo '' - exit 1 + case "${AUTO_INSTALL_FAILSAFE}" in + '') + echo "*** FATAL ERROR: Unable to install ${1} to ${2}" + echo '' + exit 1 + ;; + *) + AUTO_FAILED_INSTALLED_FILES="${AUTO_FAILED_INSTALLED_FILES} $2/${1##*/} +" + ;; + esac } do_install_and_rm () { @@ -781,11 +794,14 @@ if [ ! -d "${3}/${2##*/}" ]; then if install -m ${1} ${2} ${3}; then unlink ${2} + return 0 else install_error ${2} ${3} + return 1 fi else install_error ${2} ${3} + return 1 fi } @@ -824,7 +840,7 @@ NEED_CAP_MKDB=yes ;; /etc/master.passwd) - do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}" + do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}" || return 1 NEED_PWD_MKDB=yes DONT_INSTALL=yes ;; @@ -1113,6 +1129,28 @@ ;; esac +case "${AUTO_FAILED_INSTALLED_FILES}" in +'') ;; +*) + case "${AUTO_RUN}" in + '') + ( + echo '*** You chose the automatic install option for files that did not' + echo ' exist on your system. The following could not be installed:' + echo "${AUTO_FAILED_INSTALLED_FILES}" + echo '' + ) | ${PAGER} + ;; + *) + echo '' + echo '*** You chose the automatic install option for files that did not' + echo ' exist on your system. The following could not be installed:' + echo "${AUTO_FAILED_INSTALLED_FILES}" + ;; + esac + ;; +esac + case "${AUTO_UPGRADED_FILES}" in '') ;; *)