Index: mergemaster.sh =================================================================== RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v retrieving revision 1.53 diff -u -p -r1.53 mergemaster.sh --- mergemaster.sh 4 Feb 2006 18:24:06 -0000 1.53 +++ mergemaster.sh 11 Mar 2006 15:25:31 -0000 @@ -113,6 +113,35 @@ diff_loop () { "${HANDLE_COMPFILE}" = "NOT V" ]; do if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then + # check if the file should be autoinstalled + case "$AUTO_INSTALL_EXPR" in + '') + ;; + *) + eval "case ${COMPFILE#.} in + $AUTO_INSTALL_EXPR) + match=yes + ;; + *) + match=no + ;; + esac" + if [ $match = "yes" ]; then + echo '' + if mm_install "${COMPFILE}"; then + echo " *** ${COMPFILE} installed successfully" + echo '' + # Make the list print one file per line + AUTO_INSTALLED_FILES="${AUTO_INSTALLED_FILES} ${DESTDIR}${COMPFILE#.} +" + else + echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand" + fi + return; + fi + ;; + esac + echo '' echo ' ====================================================================== ' echo '' @@ -382,6 +411,28 @@ DIFF_FLAG=${DIFF_FLAG:--u} # SOURCEDIR=${SOURCEDIR:-/usr/src/etc} +# We really don't want to have to deal with files like login.conf.db, pwd.db, +# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. +# Prompt the user to do so below, as needed. +IGNORE_LIST="${IGNORE_LIST} etc/*.db etc/passwd" + +# Avoid comparing the motd if the user specifies it in .mergemasterrc +case "${IGNORE_MOTD}" in +'') ;; +*) + IGNORE_LIST="${IGNORE_LIST} etc/motd" + ;; +esac + +# evaluate case/esac expression for files that are always installed +case "${AUTO_INSTALL_LIST}" in +'') + ;; +*) + AUTO_INSTALL_EXPR=`echo "$AUTO_INSTALL_LIST" | xargs echo | sed 's/ /|/g'` + ;; +esac + # Check the width of the user's terminal # if [ -t 0 ]; then @@ -553,12 +604,16 @@ case "${RERUN}" in ;; esac - # Avoid comparing the motd if the user specifies it in .mergemasterrc - case "${IGNORE_MOTD}" in - '') ;; - *) rm -f ${TEMPROOT}/etc/motd - ;; - esac + # Avoid comparing files from IGNORE_LIST + for i in ${IGNORE_LIST}; do + case "$i" in + ..|../*|*/..|*/../*) + ;; + *) + rm -rf ${TEMPROOT}/$i + ;; + esac + done # Avoid trying to update MAKEDEV if /dev is on a devfs if /sbin/sysctl vfs.devfs.generation > /dev/null 2>&1 ; then @@ -568,12 +623,6 @@ case "${RERUN}" in ;; # End of the "RERUN" test esac -# We really don't want to have to deal with files like login.conf.db, pwd.db, -# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. -# Prompt the user to do so below, as needed. -# -rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd - # We only need to compare things like freebsd.cf once find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null