5 # Compare files created by /usr/src/etc/Makefile (or the directory
6 # the user specifies) with the currently installed copies.
8 # Copyright 1998-2003 Douglas Barton
11 # $FreeBSD: src/usr.sbin/mergemaster/mergemaster.sh,v 1.46 2003/05/03 06:35:19 dougb Exp $
12 # $DragonFly: src/usr.sbin/mergemaster/mergemaster.sh,v 1.6 2004/03/14 13:47:12 eirikn Exp $
14 PATH
=/bin
:/usr
/bin
:/usr
/sbin
17 VERSION_NUMBER
=`grep "[$]DragonFly:" $0 | cut -d ' ' -f 4`
18 echo "mergemaster version ${VERSION_NUMBER}"
19 echo 'Usage: mergemaster [-scrvahipCP] [-m /path]'
20 echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]'
22 echo " -s Strict comparison (diff every pair of files)"
23 echo " -c Use context diff instead of unified diff"
24 echo " -r Re-run on a previously cleaned directory (skip temproot creation)"
25 echo " -v Be more verbose about the process, include additional checks"
26 echo " -a Leave all files that differ to merge by hand"
27 echo " -h Display more complete help"
28 echo ' -i Automatically install files that do not exist in destination directory'
29 echo ' -p Pre-buildworld mode, only compares crucial files'
30 echo ' -C Compare local rc.conf variables to the defaults'
31 echo ' -P Preserve files that are overwritten'
32 echo " -m /path/directory Specify location of source to do the make in"
33 echo " -t /path/directory Specify temp root directory"
34 echo " -d Add date and time to directory name (e.g., /var/tmp/temproot.`date +%m%d.%H.%M`)"
35 echo " -u N Specify a numeric umask"
36 echo " -w N Specify a screen width in columns to sdiff"
37 echo ' -D /path/directory Specify the destination directory to install files to'
42 echo "* To specify a directory other than /var/tmp/temproot for the"
43 echo " temporary root environment, use -t /path/to/temp/root"
44 echo "* The -w option takes a number as an argument for the column width"
45 echo " of the screen. The default is 80."
46 echo '* The -a option causes mergemaster to run without prompting.'
49 # Loop allowing the user to use sdiff to merge files and display the merged
55 echo " *** Type h at the sdiff prompt (%) to get usage help"
60 while [ "${MERGE_AGAIN}" = "yes" ]; do
61 # Prime file.merged so we don't blat the owner/group id's
62 cp -p "${COMPFILE}" "${COMPFILE}.merged"
63 sdiff -o "${COMPFILE}.merged" --text --suppress-common-lines \
64 --width=${SCREEN_WIDTH:-80} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}"
66 while [ "${INSTALL_MERGED}" = "v
" -o "${INSTALL_MERGED}" = "V
" ]; do
68 echo " Use
'i' to
install merged
file"
69 echo " Use
'r' to re-do the merge
"
70 echo " Use
'v' to view the merged
file"
71 echo " Default is to leave the temporary
file to deal with by hand
"
73 echo -n " *** How should I deal with the merged
file?
[Leave it
for later
] "
76 case "${INSTALL_MERGED}" in
78 mv "${COMPFILE}.merged
" "${COMPFILE}"
80 if mm_install "${COMPFILE}"; then
81 echo " *** Merged version of
${COMPFILE} installed successfully
"
83 echo " *** Problem installing
${COMPFILE}, it will remain to merge by hand later
"
88 rm "${COMPFILE}.merged
"
91 ${PAGER} "${COMPFILE}.merged
"
94 echo " *** ${COMPFILE} will remain
for your consideration
"
98 echo "invalid choice
: ${INSTALL_MERGED}"
106 # Loop showing user differences between files, allow merge, skip or install
112 while [ "${HANDLE_COMPFILE}" = "v
" -o "${HANDLE_COMPFILE}" = "V
" -o \
113 "${HANDLE_COMPFILE}" = "NOT V
" ]; do
114 if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then
115 if [ "${HANDLE_COMPFILE}" = "v
" -o "${HANDLE_COMPFILE}" = "V
" ]; then
117 echo ' ====================================================================== '
120 echo " *** Displaying differences between
${COMPFILE} and installed version
:"
122 diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}"
128 echo " *** There is no installed version of ${COMPFILE}"
130 case "${AUTO_INSTALL}" in
133 if mm_install
"${COMPFILE}"; then
134 echo " *** ${COMPFILE} installed successfully"
136 # Make the list print one file per line
137 AUTO_INSTALLED_FILES
="${AUTO_INSTALLED_FILES} ${DESTDIR}${COMPFILE#.}
140 echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand"
150 echo " Use 'd' to delete the temporary ${COMPFILE}"
151 echo " Use 'i' to install the temporary ${COMPFILE}"
152 case "${NO_INSTALLED}" in
154 echo " Use 'm' to merge the temporary and installed versions"
155 echo " Use 'v' to view the diff results again"
159 echo " Default is to leave the temporary file to deal with by hand"
161 echo -n "How should I deal with this? [Leave it for later] "
164 case "${HANDLE_COMPFILE}" in
168 echo " *** Deleting ${COMPFILE}"
172 if mm_install
"${COMPFILE}"; then
173 echo " *** ${COMPFILE} installed successfully"
175 echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand"
179 case "${NO_INSTALLED}" in
181 # interact with user to merge files
186 echo " *** There is no installed version of ${COMPFILE}"
188 HANDLE_COMPFILE
="NOT V"
190 esac # End of "No installed version of file but user selected merge" test
197 echo " *** ${COMPFILE} will remain for your consideration"
200 # invalid choice, show menu again.
201 echo "invalid choice: ${HANDLE_COMPFILE}"
203 HANDLE_COMPFILE
="NOT V"
206 esac # End of "How to handle files that are different"
218 press_to_continue
() {
220 echo -n ' *** Press the [Enter] or [Return] key to continue '
224 # Set the default path for the temporary root environment
226 TEMPROOT
='/var/tmp/temproot'
228 # Read /etc/mergemaster.rc first so the one in $HOME can override
230 if [ -r /etc
/mergemaster.rc
]; then
231 .
/etc
/mergemaster.rc
234 # Read .mergemasterrc before command line so CLI can override
236 if [ -r "$HOME/.mergemasterrc" ]; then
237 .
"$HOME/.mergemasterrc"
240 # Check the command line options
242 while getopts ":ascrvhipCPm:t:du:w:D:" COMMAND_LINE_ARGUMENT
; do
243 case "${COMMAND_LINE_ARGUMENT}" in
255 case "${AUTO_RUN}" in
289 TEMPROOT
=${TEMPROOT}.
`date +%m%d.%H.%M`
295 SCREEN_WIDTH
=${OPTARG}
307 # Don't force the user to set this in the mergemaster rc file
308 if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then
309 PRESERVE_FILES_DIR
=/var
/tmp
/mergemaster
/preserved-files-
`date +%y%m%d-%H%M%S`
314 # If the user has a pager defined, make sure we can run it
316 case "${DONT_CHECK_PAGER}" in
318 while ! type "${PAGER%% *}" >/dev
/null
&& [ -n "${PAGER}" ]; do
319 echo " *** Your PAGER environment variable specifies '${PAGER}', but"
320 echo " due to the limited PATH that I use for security reasons,"
321 echo " I cannot execute it. So, what would you like to do?"
323 echo " Use 'e' to exit mergemaster and fix your PAGER variable"
324 if [ -x /usr
/bin
/less -o -x /usr
/local
/bin
/less ]; then
325 echo " Use 'l' to set PAGER to 'less' for this run"
327 echo " Use 'm' to use plain old 'more' as your PAGER for this run"
329 echo " Default is to use plain old 'more' "
331 echo -n "What should I do? [Use 'more'] "
334 case "${FIXPAGER}" in
339 if [ -x /usr
/bin
/less ]; then
341 elif [ -x /usr
/local
/bin
/less ]; then
342 PAGER
=/usr
/local
/bin
/less
345 echo " *** Fatal Error:"
346 echo " You asked to use 'less' as your pager, but I can't"
347 echo " find it in /usr/bin or /usr/local/bin"
356 echo "invalid choice: ${FIXPAGER}"
363 # If user has a pager defined, or got assigned one above, use it.
369 if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then
370 echo " *** You have ${PAGER} defined as your pager so we will use that"
375 # Assign the diff flag once so we will not have to keep testing it
377 DIFF_FLAG
=${DIFF_FLAG:--u}
379 # Assign the source directory
381 SOURCEDIR
=${SOURCEDIR:-/usr/src/etc}
383 # Check the width of the user's terminal
388 0|
'') ;; # No-op, since the input is not valid
390 case "${SCREEN_WIDTH}" in
391 '') SCREEN_WIDTH
="${w}" ;;
392 "${w}") ;; # No-op, since they are the same
394 echo -n "*** You entered ${SCREEN_WIDTH} as your screen width, but stty "
395 echo "thinks it is ${w}."
397 echo -n "What would you like to use? [${w}] "
399 case "${SCREEN_WIDTH}" in
400 '') SCREEN_WIDTH
="${w}" ;;
407 # Define what CVS $Id tag to look for to aid portability.
412 rm -rf "${TEMPROOT}" 2>/dev
/null
413 chflags
-R 0 "${TEMPROOT}" 2>/dev
/null
414 rm -rf "${TEMPROOT}" ||
exit 1
419 # Set up the loop to test for the existence of the
420 # temp root directory.
423 while [ "${TEST_TEMP_ROOT}" = "yes" ]; do
424 if [ -d "${TEMPROOT}" ]; then
425 echo "*** The directory specified for the temporary root environment,"
426 echo " ${TEMPROOT}, exists. This can be a security risk if untrusted"
427 echo " users have access to the system."
429 case "${AUTO_RUN}" in
431 echo " Use 'd' to delete the old ${TEMPROOT} and continue"
432 echo " Use 't' to select a new temporary root directory"
433 echo " Use 'e' to exit mergemaster"
435 echo " Default is to use ${TEMPROOT} as is"
437 echo -n "How should I deal with this? [Use the existing ${TEMPROOT}] "
440 case "${DELORNOT}" in
443 echo " *** Deleting the old ${TEMPROOT}"
445 delete_temproot ||
exit 1
449 echo " *** Enter new directory name for temporary root environment"
457 echo " *** Leaving ${TEMPROOT} intact"
463 echo "invalid choice: ${DELORNOT}"
469 # If this is an auto-run, try a hopefully safe alternative then
471 TEMPROOT
=/var
/tmp
/temproot.
`date +%m%d.%H.%M.%S`
479 echo "*** Creating the temporary root environment in ${TEMPROOT}"
481 if mkdir
-p "${TEMPROOT}"; then
482 echo " *** ${TEMPROOT} ready for use"
485 if [ ! -d "${TEMPROOT}" ]; then
487 echo " *** FATAL ERROR: Cannot create ${TEMPROOT}"
492 echo " *** Creating and populating directory structure in ${TEMPROOT}"
502 case "${PRE_WORLD}" in
508 make DESTDIR
=${DESTDIR} distrib-dirs
511 make DESTDIR
=${TEMPROOT} distrib-dirs
&&
512 make MAKEOBJDIRPREFIX
=${TEMPROOT}/usr
/obj obj
&&
513 make MAKEOBJDIRPREFIX
=${TEMPROOT}/usr
/obj DESTDIR
=${TEMPROOT} \
514 -DNO_MAKEDEV_RUN distribution
;} ||
516 echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
517 echo " the temproot environment";
522 # Only set up files that are crucial to {build|install}world
523 { mkdir
-p ${TEMPROOT}/etc
&&
524 cp -p ${SOURCEDIR}/master.passwd
${TEMPROOT}/etc
&&
525 cp -p ${SOURCEDIR}/group ${TEMPROOT}/etc;} ||
527 echo ' *** FATAL ERROR: Cannot copy files to the temproot environment';
533 # Doing the inventory and removing files that we don't want to compare only
534 # makes sense if we are not doing a rerun, since we have no way of knowing
535 # what happened to the files during previous incarnations.
540 echo ' *** The following files exist only in the installed version of'
541 echo " ${DESTDIR}/etc. In the vast majority of cases these files"
542 echo ' are necessary parts of the system and should not be deleted.'
543 echo ' However because these files are not updated by this process you'
544 echo ' might want to verify their status before rebooting your system.'
547 diff -qr ${DESTDIR}/etc ${TEMPROOT}/etc | grep "^Only in ${DESTDIR}/etc" | ${PAGER}
553 # Avoid comparing the motd if the user specifies it in .mergemasterrc
554 case "${IGNORE_MOTD}" in
556 *) rm -f ${TEMPROOT}/etc
/motd
560 # Avoid trying to update MAKEDEV if /dev is on a devfs
561 if /sbin
/sysctl vfs.devfs.generation
> /dev
/null
2>&1 ; then
562 rm -f ${TEMPROOT}/dev
/MAKEDEV
${TEMPROOT}/dev
/MAKEDEV.
local
565 ;; # End of the "RERUN" test
568 # We really don't want to have to deal with files like login.conf.db, pwd.db,
569 # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb.
570 # Prompt the user to do so below, as needed.
572 rm -f ${TEMPROOT}/etc
/*.db
${TEMPROOT}/etc
/passwd
574 # We only need to compare things like freebsd.cf once
575 find ${TEMPROOT}/usr
/obj
-type f
-delete 2>/dev
/null
577 # Get ready to start comparing files
579 # Check umask if not specified on the command line,
580 # and we are not doing an autorun
582 if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then
584 case "${USER_UMASK}" in
588 echo " *** Your umask is currently set to ${USER_UMASK}. By default, this script"
589 echo " installs all files with the same user, group and modes that"
590 echo " they are created with by ${SOURCEDIR}/Makefile, compared to"
591 echo " a umask of 022. This umask allows world read permission when"
592 echo " the file's default permissions have it."
594 echo " No world permissions can sometimes cause problems. A umask of"
595 echo " 022 will restore the default behavior, but is not mandatory."
596 echo " /etc/master.passwd is a special case. Its file permissions"
597 echo " will be 600 (rw-------) if installed."
599 echo -n "What umask should I use? [${USER_UMASK}] "
602 NEW_UMASK
="${NEW_UMASK:-$USER_UMASK}"
608 CONFIRMED_UMASK
=${NEW_UMASK:-0022}
611 # Warn users who still have old rc files
613 for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
614 serial syscons sysctl alpha amd64 i386 ia64 sparc64
; do
615 if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
621 case "${OLD_RC_PRESENT}" in
624 echo " *** There are elements of the old rc system in ${DESTDIR}/etc/."
626 echo ' While these scripts will not hurt anything, they are not'
627 echo ' functional on an up to date system, and can be removed.'
630 case "${AUTO_RUN}" in
632 echo -n 'Move these files to /var/tmp/mergemaster/old_rc? [yes] '
635 case "${MOVE_OLD_RC}" in
638 mkdir
-p /var
/tmp
/mergemaster
/old_rc
639 for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
640 serial syscons sysctl alpha amd64 i386 ia64 sparc64
; do
641 if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
642 mv ${DESTDIR}/etc
/rc.
${file} /var
/tmp
/mergemaster
/old_rc
/
645 echo ' The files have been moved'
654 # Use the umask/mode information to install the files
655 # Create directories as needed
657 do_install_and_rm
() {
658 case "${PRESERVE_FILES}" in
660 if [ -f "${3}/${2##*/}" ]; then
661 mkdir
-p ${PRESERVE_FILES_DIR}/${2%/*}
662 cp ${3}/${2##*/} ${PRESERVE_FILES_DIR}/${2%/*}
667 install -m "${1}" "${2}" "${3}" &&
671 # 4095 = "obase=10;ibase=8;07777" | bc
674 OCTAL
=$
(( ~$
(echo "obase=10;ibase=8; ${CONFIRMED_UMASK}" |
bc) & 4095 &
675 $
(echo "obase=10; ibase=8; $(stat -f "%OMp
%OLp
" ${1})" |
bc) ))
676 printf "%04o\n" ${OCTAL}
682 INSTALL_DIR
=${INSTALL_DIR%/*}
684 case "${INSTALL_DIR}" in
690 if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then
691 DIR_MODE
=`find_mode "${TEMPROOT}/${INSTALL_DIR}"`
692 install -d -o root
-g wheel
-m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}"
695 FILE_MODE
=`find_mode "${1}"`
697 if [ ! -x "${1}" ]; then
706 do_install_and_rm
600 "${1}" "${DESTDIR}${INSTALL_DIR}"
711 case "${AUTO_INSTALL}" in
713 case "${LINK_EXPLAINED}" in
715 echo " *** Historically BSD derived systems have had a"
716 echo " hard link from /.cshrc and /.profile to"
717 echo " their namesakes in /root. Please indicate"
718 echo " your preference below for bringing your"
719 echo " installed files up to date."
725 echo " Use 'd' to delete the temporary ${COMPFILE}"
726 echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link"
728 echo " Default is to leave the temporary file to deal with by hand"
730 echo -n " How should I handle ${COMPFILE}? [Leave it to install later] "
733 *) # Part of AUTO_INSTALL
738 case "${HANDLE_LINK}" in
742 echo " *** Deleting ${COMPFILE}"
746 rm -f "${DESTDIR}${COMPFILE#.}"
747 if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then
748 echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully"
751 echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand"
755 echo " *** ${COMPFILE} will remain for your consideration"
762 case "${DONT_INSTALL}" in
764 do_install_and_rm
"${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
770 else # File matched -x
776 do_install_and_rm
"${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
782 echo "*** Beginning comparison"
787 if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; then
788 .
"${MM_PRE_COMPARE_SCRIPT}"
791 # Using -size +0 avoids uselessly checking the empty log files created
792 # by ${SOURCEDIR}/Makefile and the device entries in ./dev, but does
793 # check the scripts in ./dev, as we'd like (assuming no devfs of course).
795 for COMPFILE
in `find . -type f -size +0`; do
797 # First, check to see if the file exists in DESTDIR. If not, the
798 # diff_loop function knows how to handle it.
800 if [ ! -e "${DESTDIR}${COMPFILE#.}" ]; then
801 case "${AUTO_RUN}" in
806 case "${AUTO_INSTALL}" in
808 # If this is an auto run, make it official
809 echo " *** ${COMPFILE} will remain for your consideration"
822 # Compare CVS $Id's first so if the file hasn't been modified
823 # local changes will be ignored.
824 # If the files have the same $Id, delete the one in temproot so the
825 # user will have less to wade through if files are left to merge by hand.
827 CVSID1
=`grep "[$]${CVS_ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null`
828 CVSID2
=`grep "[$]${CVS_ID_TAG}:" ${COMPFILE} 2>/dev/null` || CVSID2
=none
832 echo " *** Temp ${COMPFILE} and installed have the same CVS Id, deleting"
839 # If the file is still here either because the $Ids are different, the
840 # file doesn't have an $Id, or we're using STRICT mode; look at the diff.
842 if [ -f "${COMPFILE}" ]; then
844 # Do an absolute diff first to see if the files are actually different.
845 # If they're not different, delete the one in temproot.
847 if diff -q ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \
849 echo " *** Temp
${COMPFILE} and installed are the same
, deleting
"
852 # Ok, the files are different, so show the user where they differ.
853 # Use user's choice of diff methods; and user's pager if they have one.
855 # Use unified diffs by default. Context diffs give me a headache. :)
857 case "${AUTO_RUN}" in
859 # prompt user to install/delete/merge changes
863 # If this is an auto run, make it official
864 echo " *** ${COMPFILE} will remain
for your consideration
"
867 fi # Yes, the files are different
868 fi # Yes, the file still remains to be checked
869 done # This is for the do way up there at the beginning of the comparison
872 echo "*** Comparison complete
"
875 TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null`
876 if [ -n "${TEST_FOR_FILES}" ]; then
877 echo "*** Files that remain
for you to merge by hand
:"
878 find "${TEMPROOT}" -type f -size +0
882 case "${AUTO_RUN}" in
884 echo -n "Do you wish to delete what is left of
${TEMPROOT}?
[no
] "
887 case "${DEL_TEMPROOT}" in
889 if delete_temproot; then
890 echo " *** ${TEMPROOT} has been deleted
"
892 echo " *** Unable to delete
${TEMPROOT}"
896 echo " *** ${TEMPROOT} will remain
"
903 case "${AUTO_INSTALLED_FILES}" in
906 case "${AUTO_RUN}" in
910 echo '*** You chose the automatic install option for files that did not'
911 echo ' exist on your system. The following were installed for you:'
912 echo "${AUTO_INSTALLED_FILES}"
917 echo '*** You chose the automatic install option for files that did not'
918 echo ' exist on your system. The following were installed for you:'
919 echo "${AUTO_INSTALLED_FILES}"
926 case "${AUTO_RUN}" in
930 echo -n ' Would you like to run it now? y or n [n] '
933 case "${YES_OR_NO}" in
941 echo " *** Cancelled
"
943 echo " Make sure to run
${1} yourself
"
947 echo " *** Sorry
, I
do not understand your answer
(${YES_OR_NO})"
949 echo " Make sure to run
${1} yourself
"
956 case "${NEED_MAKEDEV}" in
960 echo "*** You installed a new
${DESTDIR}/dev
/MAKEDEV
script, so
make sure that you run
"
961 echo " 'cd ${DESTDIR}/dev && /bin/sh MAKEDEV all' to rebuild your devices
"
962 run_it_now "cd ${DESTDIR}/dev
&& /bin
/sh MAKEDEV all
"
966 case "${NEED_NEWALIASES}" in
970 if [ -n "${DESTDIR}" ]; then
971 echo "*** You installed a new aliases
file into
${DESTDIR}/etc
/mail, but
"
972 echo " the newaliases
command is limited to the directories configured
"
973 echo " in sendmail.cf. Make sure to create your aliases database by
"
974 echo " hand when your sendmail configuration is
done.
"
976 echo "*** You installed a new aliases
file, so
make sure that you run
"
977 echo " '/usr/bin/newaliases' to rebuild your aliases database
"
978 run_it_now '/usr/bin/newaliases'
983 case "${NEED_CAP_MKDB}" in
987 echo "*** You installed a login.conf
file, so
make sure that you run
"
988 echo " '/usr/bin/cap_mkdb ${DESTDIR}/etc/login.conf'"
989 echo " to rebuild your login.conf database
"
990 run_it_now "/usr
/bin
/cap_mkdb
${DESTDIR}/etc
/login.conf
"
994 case "${NEED_PWD_MKDB}" in
998 echo "*** You installed a new master.passwd
file, so
make sure that you run
"
999 if [ -n "${DESTDIR}" ]; then
1000 echo " '/usr/sbin/pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd'"
1001 echo " to rebuild your password files
"
1002 run_it_now "/usr
/sbin
/pwd_mkdb
-d ${DESTDIR}/etc
-p ${DESTDIR}/etc
/master.passwd
"
1004 echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'"
1005 echo " to rebuild your password files
"
1006 run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd'
1013 if [ -r "${MM_EXIT_SCRIPT}" ]; then
1014 . "${MM_EXIT_SCRIPT}"
1017 case "${COMP_CONFS}" in
1020 . ${DESTDIR}/etc/defaults/rc.conf
1023 echo "*** Comparing conf files
: ${rc_conf_files}"
1025 for CONF_FILE in ${rc_conf_files}; do
1026 if [ -r "${DESTDIR}${CONF_FILE}" ]; then
1028 echo "*** From
${DESTDIR}${CONF_FILE}"
1029 echo "*** From
${DESTDIR}/etc
/defaults
/rc.conf
"
1031 for RC_CONF_VAR in `grep -i ^[a-z] ${DESTDIR}${CONF_FILE} |
1032 cut -d '=' -f 1`; do
1034 grep -w ^${RC_CONF_VAR} ${DESTDIR}${CONF_FILE}
1035 grep -w ^${RC_CONF_VAR} ${DESTDIR}/etc/defaults/rc.conf ||
1036 echo ' * No default variable with this name'
1044 case "${PRE_WORLD}" in
1047 MAKE_CONF="${SOURCEDIR%etc}etc
/defaults
/make.conf
"
1050 echo '*** Comparing make variables'
1052 echo "*** From
${DESTDIR}/etc
/make.conf
"
1053 echo "*** From
${MAKE_CONF}"
1055 for MAKE_VAR in `grep -i ^[a-z] ${DESTDIR}/etc/make.conf | cut -d '=' -f 1`; do
1057 grep -w ^${MAKE_VAR} ${DESTDIR}/etc/make.conf
1058 grep -w ^#${MAKE_VAR} ${MAKE_CONF} ||
1059 echo ' * No example variable with this name'