mergemaster.sh revision 67859
1#!/bin/sh
2
3# mergemaster
4
5# Compare files created by /usr/src/etc/Makefile (or the directory
6# the user specifies) with the currently installed copies.
7
8# Copyright 1998-2000 Douglas Barton
9# Doug@gorean.org
10
11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 67859 2000-10-29 09:40:22Z dougb $
12
13PATH=/bin:/usr/bin:/usr/sbin:/sbin
14
15display_usage () {
16  VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
17  echo "mergemaster version ${VERSION_NUMBER}"
18  echo "Usage: mergemaster [-scrvah] [-m /path] [-t /path] [-d] [-u N] [-w N]"
19  echo "Options:"
20  echo "  -s  Strict comparison (diff every pair of files)"
21  echo "  -c  Use context diff instead of unified diff"
22  echo "  -r  Re-run on a previously cleaned directory (skip temproot creation)"
23  echo "  -v  Be more verbose about the process, include additional checks"
24  echo "  -a  Leave all files that differ to merge by hand"
25  echo "  -h  Display more complete help"
26  echo "  -m /path/directory  Specify location of source to do the make in"
27  echo "  -t /path/directory  Specify temp root directory"
28  echo "  -d  Add date and time to directory name (e.g., /var/tmp/temproot.`date +%m%d.%H.%M`)"
29  echo "  -u N  Specify a numeric umask"
30  echo "  -w N  Specify a screen width in columns to sdiff"
31  echo ''
32}
33
34display_help () {
35  echo "* To create a temporary root environment, compare CVS revision \$Ids"
36  echo "  for files that have them, and compare diffs for files that do not,"
37  echo "  or have different ones, just type, mergemaster"
38  echo "* To specify a directory other than /var/tmp/temproot for the"
39  echo "  temporary root environment, use -t /path/to/temp/root"
40  echo "* The -w option takes a number as an argument for the column width"
41  echo "  of the screen.  The default is 80."
42  echo "* The -a option causes mergemaster to run without prompting"
43}
44
45
46# Loop allowing the user to use sdiff to merge files and display the merged
47# file.
48merge_loop () {
49  case "${VERBOSE}" in
50  '') ;;
51  *)
52      echo "   *** Type h at the sdiff prompt (%) to get usage help"
53      ;;
54  esac
55  echo ''
56  MERGE_AGAIN=yes
57  while [ "${MERGE_AGAIN}" = "yes" ]; do
58    # Prime file.merged so we don't blat the owner/group id's
59    cp -p "${COMPFILE}" "${COMPFILE}.merged"
60    sdiff -o "${COMPFILE}.merged" --text --suppress-common-lines \
61      --width=${SCREEN_WIDTH:-80} "${COMPFILE#.}" "${COMPFILE}"
62    INSTALL_MERGED=V
63    while [ "${INSTALL_MERGED}" = "v" -o "${INSTALL_MERGED}" = "V" ]; do
64      echo ''
65      echo "  Use 'i' to install merged file"
66      echo "  Use 'r' to re-do the merge"
67      echo "  Use 'v' to view the merged file"
68      echo "  Default is to leave the temporary file to deal with by hand"
69      echo ''
70      echo -n "    *** How should I deal with the merged file? [Leave it for later] "
71      read INSTALL_MERGED
72
73      case "${INSTALL_MERGED}" in
74      [iI])
75        mv "${COMPFILE}.merged" "${COMPFILE}"
76        echo ''
77        if mm_install "${COMPFILE}"; then
78          echo "     *** Merged version of ${COMPFILE} installed successfully"
79        else
80          echo "     *** Problem installing ${COMPFILE}, it will remain to merge by hand later"
81        fi
82        unset MERGE_AGAIN
83        ;;
84      [rR])
85        rm "${COMPFILE}.merged"
86        ;;
87      [vV])
88        ${PAGER} "${COMPFILE}.merged"
89        ;;
90      '')
91        echo "   *** ${COMPFILE} will remain for your consideration"
92        unset MERGE_AGAIN
93        ;;
94      *)
95        echo "invalid choice: ${INSTALL_MERGED}"
96        INSTALL_MERGED=V
97        ;;
98      esac
99    done
100  done
101}
102
103# Loop showing user differences between files, allow merge, skip or install
104# options
105diff_loop () {
106
107  HANDLE_COMPFILE=v
108
109  while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o "${HANDLE_COMPFILE}" = "NOT V" ]; do
110    if [ -f "${COMPFILE#.}" -a -f "${COMPFILE}" ]; then
111      if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then
112        (
113          echo "  *** Displaying differences between ${COMPFILE} and installed version:"
114          echo ''
115        diff "${DIFF_FLAG}" "${COMPFILE#.}" "${COMPFILE}"
116        ) | ${PAGER}
117        echo ''
118      fi
119    else
120      echo "  *** There is no installed version of ${COMPFILE}"
121      NO_INSTALLED=yes
122    fi
123
124    echo "  Use 'd' to delete the temporary ${COMPFILE}"
125    echo "  Use 'i' to install the temporary ${COMPFILE}"
126    case "${NO_INSTALLED}" in
127    '')
128      echo "  Use 'm' to merge the old and new versions"
129      echo "  Use 'v' to view to differences between the old and new versions again"
130      ;;
131    esac
132    echo ''
133    echo "  Default is to leave the temporary file to deal with by hand"
134    echo ''
135    echo -n "How should I deal with this? [Leave it for later] "
136    read HANDLE_COMPFILE
137
138    case "${HANDLE_COMPFILE}" in
139    [dD])
140      rm "${COMPFILE}"
141      echo ''
142      echo "   *** Deleting ${COMPFILE}"
143      ;;
144    [iI])
145      echo ''
146      if mm_install "${COMPFILE}"; then
147        echo "   *** ${COMPFILE} installed successfully"
148      else
149        echo "   *** Problem installing ${COMPFILE}, it will remain to merge by hand"
150      fi
151      ;;
152    [mM])
153      case "${NO_INSTALLED}" in
154      '')
155        # interact with user to merge files
156        merge_loop
157        ;;
158      *)
159        echo ''
160        echo "   *** There is no installed version of ${COMPFILE}"
161        echo ''
162        HANDLE_COMPFILE="NOT V"
163        ;;
164      esac # End of "No installed version of file but user selected merge" test
165      ;;
166    [vV])
167      continue
168      ;;
169    '')
170      echo ''
171      echo "   *** ${COMPFILE} will remain for your consideration"
172      ;;
173    *)
174      # invalid choice, show menu again.
175      echo "invalid choice: ${HANDLE_COMPFILE}"
176      echo ''
177      HANDLE_COMPFILE="NOT V"
178      continue
179      ;;
180    esac  # End of "How to handle files that are different"
181  done
182  echo ''
183  unset NO_INSTALLED
184  echo ''
185  case "${VERBOSE}" in
186  '') ;;
187  *)
188    sleep 3
189    ;;
190  esac
191}
192
193# Set the default path for the temporary root environment
194#
195TEMPROOT='/var/tmp/temproot'
196
197# Read .mergemasterrc before command line so CLI can override
198#
199if [ -f "$HOME/.mergemasterrc" ]; then
200  . "$HOME/.mergemasterrc"
201fi
202
203# Check the command line options
204#
205while getopts ":ascrvhm:t:du:w:" COMMAND_LINE_ARGUMENT ; do
206  case "${COMMAND_LINE_ARGUMENT}" in
207  s)
208    STRICT=yes
209    ;;
210  c)
211    DIFF_FLAG='-c'
212    ;;
213  r)
214    RERUN=yes
215    ;;
216  v)
217    case "${AUTO_RUN}" in
218    '') VERBOSE=yes ;;
219    esac
220    ;;
221  a)
222    AUTO_RUN=yes
223    unset VERBOSE
224    ;;
225  h)
226    display_usage
227    display_help
228    exit 0
229    ;;
230  m)
231    SOURCEDIR=${OPTARG}
232    ;;
233  t)
234    TEMPROOT=${OPTARG}
235    ;;
236  d)
237    TEMPROOT=${TEMPROOT}.`date +%m%d.%H.%M`
238    ;;
239  u)
240    NEW_UMASK=${OPTARG}
241    ;;
242  w)
243    SCREEN_WIDTH=${OPTARG}
244    ;;
245  *)
246    display_usage
247    exit 1
248    ;;
249  esac
250done
251
252echo ''
253
254# If the user has a pager defined, make sure we can run it
255#
256case "${DONT_CHECK_PAGER}" in
257'')
258  while ! type "${PAGER%% *}" >/dev/null && [ -n "${PAGER}" ]; do
259    echo " *** Your PAGER environment variable specifies '${PAGER}', but"
260    echo "     due to the limited PATH that I use for security reasons,"
261    echo "     I cannot execute it.  So, what would you like to do?"
262    echo ''
263    echo "  Use 'e' to exit mergemaster and fix your PAGER variable"
264    if [ -x /usr/bin/less -o -x /usr/local/bin/less ]; then
265    echo "  Use 'l' to set PAGER to 'less' for this run"
266    fi
267    echo "  Use 'm' to use plain old 'more' as your PAGER for this run"
268    echo ''
269    echo "  Default is to use plain old 'more' "
270    echo ''
271    echo -n "What should I do? [Use 'more'] "
272    read FIXPAGER
273
274    case "${FIXPAGER}" in
275    [eE])
276       exit 0
277       ;;
278    [lL])
279       if [ -x /usr/bin/less ]; then
280         PAGER=/usr/bin/less
281       elif [ -x /usr/local/bin/less ]; then
282         PAGER=/usr/local/bin/less
283       else
284         echo ''
285         echo " *** Fatal Error:"
286         echo "     You asked to use 'less' as your pager, but I can't"
287         echo "     find it in /usr/bin or /usr/local/bin"
288         exit 1
289       fi
290       ;;
291    [mM]|'')
292       PAGER=more
293       ;;
294    *)
295       echo ''
296       echo "invalid choice: ${FIXPAGER}"
297    esac
298    echo ''
299  done
300  ;;
301esac
302
303# If user has a pager defined, or got assigned one above, use it.
304# If not, use more.
305#
306PAGER=${PAGER:-more}
307
308if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then
309  echo " *** You have ${PAGER} defined as your pager so we will use that"
310  echo ''
311  sleep 3
312fi
313
314# Assign the diff flag once so we will not have to keep testing it
315#
316DIFF_FLAG=${DIFF_FLAG:--u}
317
318# Assign the source directory
319#
320SOURCEDIR=${SOURCEDIR:-/usr/src/etc}
321
322case "${RERUN}" in
323'')
324  # Set up the loop to test for the existence of the
325  # temp root directory.
326  #
327  TEST_TEMP_ROOT=yes
328  while [ "${TEST_TEMP_ROOT}" = "yes" ]; do
329    if [ -d "${TEMPROOT}" ]; then
330      echo "*** The directory specified for the temporary root environment,"
331      echo "    ${TEMPROOT}, exists.  This can be a security risk if untrusted"
332      echo "    users have access to the system."
333      echo ''
334      case "${AUTO_RUN}" in
335      '')
336        echo "  Use 'd' to delete the old ${TEMPROOT} and continue"
337        echo "  Use 't' to select a new temporary root directory"
338        echo "  Use 'e' to exit mergemaster"
339        echo ''
340        echo "  Default is to use ${TEMPROOT} as is"
341        echo ''
342        echo -n "How should I deal with this? [Use the existing ${TEMPROOT}] "
343        read DELORNOT
344
345        case "${DELORNOT}" in
346        [dD])
347          echo ''
348          echo "   *** Deleting the old ${TEMPROOT}"
349          echo ''
350          rm -rf "${TEMPROOT}"
351          unset TEST_TEMP_ROOT
352          ;;
353        [tT])
354          echo "   *** Enter new directory name for temporary root environment"
355          read TEMPROOT
356          ;;
357        [eE])
358          exit 0
359          ;;
360        '')
361          echo ''
362          echo "   *** Leaving ${TEMPROOT} intact"
363          echo ''
364          unset TEST_TEMP_ROOT
365          ;;
366        *)
367          echo ''
368          echo "invalid choice: ${DELORNOT}"
369          echo ''
370          ;;
371        esac
372        ;;
373      *)
374        # If this is an auto-run, try a hopefully safe alternative then re-test anyway
375        TEMPROOT=/var/tmp/temproot.`date +%m%d.%H.%M.%S`
376        ;;
377      esac
378    else
379      unset TEST_TEMP_ROOT
380    fi
381  done
382
383  echo "*** Creating the temporary root environment in ${TEMPROOT}"
384
385  if mkdir -p "${TEMPROOT}"; then
386    echo " *** ${TEMPROOT} ready for use"
387  fi
388
389  if [ ! -d "${TEMPROOT}" ]; then
390    echo ''
391    echo "  *** FATAL ERROR: Cannot create ${TEMPROOT}"
392    echo ''
393    exit 1
394  fi
395
396  echo " *** Creating and populating directory structure in ${TEMPROOT}"
397  echo ''
398
399  case "${VERBOSE}" in
400  '') ;;
401  *)
402    echo " *** Press [Enter] or [Return] key to continue"
403    read ANY_KEY
404    unset ANY_KEY
405    ;;
406  esac
407
408  { cd ${SOURCEDIR} &&
409    make DESTDIR=${TEMPROOT} distrib-dirs &&
410    make DESTDIR=${TEMPROOT} -DNO_MAKEDEV distribution;} ||
411  { echo '';
412    echo "  *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to the";
413    echo "      temproot environment";
414    echo '';
415    exit 1;}
416
417  # We really don't want to have to deal with these files, since
418  # master.passwd is the real file that should be compared, then
419  # the user should run pwd_mkdb if necessary.
420  # Only do this if we are not rerun'ing, since if we are the
421  # files will not be there.
422  #
423  rm ${TEMPROOT}/etc/spwd.db ${TEMPROOT}/etc/passwd ${TEMPROOT}/etc/pwd.db
424
425  # Avoid comparing the motd if the user specifies it in .mergemasterrc
426  case "${IGNORE_MOTD}" in
427  '') ;;
428  *) rm ${TEMPROOT}/etc/motd
429     ;;
430  esac
431
432  # Avoid trying to update MAKEDEV if /dev is on a devfs
433  if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
434    rm ${TEMPROOT}/dev/MAKEDEV ${TEMPROOT}/dev/MAKEDEV.local
435  fi
436
437  ;; # End of the "RERUN" test
438esac
439
440# Get ready to start comparing files
441
442case "${VERBOSE}" in
443'') ;;
444*)
445  echo ''
446  echo " *** The following files exist only in the installed version"
447  echo "     of /etc.  In the far majority of cases these files are"
448  echo "     necessary parts of the system and should not be deleted,"
449  echo "     however because these files are not updated by this process"
450  echo "     you might want to verify their status before rebooting your system."
451  echo ''
452  echo " *** Press [Enter] or [Return] key to continue"
453  read ANY_KEY
454  unset ANY_KEY
455  diff -qr /etc ${TEMPROOT}/etc | grep "^Only in /etc" | ${PAGER}
456  echo ''
457  echo " *** Press [Enter] or [Return] key to continue"
458  read ANY_KEY
459  unset ANY_KEY
460  ;;
461esac
462
463# Check umask if not specified on the command line,
464# and we are not doing an autorun
465#
466if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then
467  USER_UMASK=`umask`
468  case "${USER_UMASK}" in
469  0022) ;;
470  *)
471    echo ''
472    echo " *** Your umask is currently set to ${USER_UMASK}.  By default, this script"
473    echo "     installs all files with the same user, group and modes that"
474    echo "     they are created with by ${SOURCEDIR}/Makefile, compared to"
475    echo "     a umask of 022.  This umask allows world read permission when"
476    echo "     the file's default permissions have it."
477    echo "     No world permissions can sometimes cause problems.  A umask of"
478    echo "     022 will restore the default behavior, but is not mandatory."
479    echo "     /etc/master.passwd is a special case.  Its file permissions"
480    echo "     will be 600 (rw-------) if installed."
481    echo ''
482    echo -n "What umask should I use? [${USER_UMASK}] "
483    read NEW_UMASK
484
485    NEW_UMASK="${NEW_UMASK:-$USER_UMASK}"
486    ;;
487  esac
488  echo ''
489fi
490
491CONFIRMED_UMASK=${NEW_UMASK:-0022}
492
493# Warn users who have an /etc/sysconfig file
494#
495if [ -f /etc/sysconfig ]; then
496  echo " *** There is an /etc/sysconfig file on this system.  Starting with"
497  echo "     FreeBSD version 2.2.2 those settings have moved from /etc/sysconfig"
498  echo "     to /etc/rc.conf.  If you are upgrading an older system make sure"
499  echo "     that you transfer your settings by hand from sysconfig to rc.conf and"
500  echo "     install the rc.conf file.  If you have already made this transition,"
501  echo "     you should consider renaming or deleting the /etc/sysconfig file."
502  echo ''
503  case "${AUTO_RUN}" in
504  '')
505    echo -n "Continue with the merge process? [yes] "
506    read CONT_OR_NOT
507
508    case "${CONT_OR_NOT}" in
509    [nN]*)
510      exit 0
511      ;;
512    *)
513      echo "   *** Continuing"
514      echo ''
515      ;;
516    esac
517    ;;
518  *) ;;
519  esac
520fi
521
522echo ''
523echo "*** Beginning comparison"
524echo ''
525
526cd "${TEMPROOT}"
527
528# Use the umask/mode information to install the files
529# Create directories as needed
530#
531mm_install () {
532  local INSTALL_DIR
533  INSTALL_DIR=${1#.}
534  INSTALL_DIR=${INSTALL_DIR%/*}
535  case "${INSTALL_DIR}" in
536  '')
537    INSTALL_DIR=/
538    ;;
539  esac
540
541  if [ -n "${INSTALL_DIR}" -a ! -d "${INSTALL_DIR}" ]; then
542    DIR_MODE=`perl -e 'printf "%04o\n", (((stat("$ARGV[0]"))[2] & 07777) &~ oct("$ARGV[1]"))' "${TEMPROOT}/${INSTALL_DIR}" "${CONFIRMED_UMASK}"`
543    install -d -o root -g wheel -m "${DIR_MODE}" "${INSTALL_DIR}"
544  fi
545
546  FILE_MODE=`perl -e 'printf "%04o\n", (((stat("$ARGV[0]"))[2] & 07777) &~ oct("$ARGV[1]"))' "${1}" "${CONFIRMED_UMASK}"`
547
548  if [ ! -x "${1}" ]; then
549    case "${1#.}" in
550    /dev/MAKEDEV)
551      NEED_MAKEDEV=yes
552      ;;
553    /etc/mail/aliases)
554      NEED_NEWALIASES=yes
555      ;;
556    /etc/login.conf)
557      NEED_CAP_MKDB=yes
558      ;;
559    /etc/master.passwd)
560      install -m 600 "${1}" "${INSTALL_DIR}"
561      NEED_PWD_MKDB=yes
562      DONT_INSTALL=yes
563      ;;
564    /.cshrc | /.profile)
565      case "${LINK_EXPLAINED}" in
566      '')
567        echo "   *** Historically BSD derived systems have had a"
568        echo "       hard link from /.cshrc and /.profile to"
569        echo "       their namesakes in /root.  Please indicate"
570        echo "       your preference below for bringing your"
571        echo "       installed files up to date."
572        echo ''
573        LINK_EXPLAINED=yes
574        ;;
575      esac
576
577      echo "   Use 'd' to delete the temporary ${COMPFILE}"
578      echo "   Use 'l' to delete the existing ${COMPFILE#.} and create the link"
579      echo ''
580      echo "   Default is to leave the temporary file to deal with by hand"
581      echo ''
582      echo -n "  How should I handle ${COMPFILE}? [Leave it to install later] "
583      read HANDLE_LINK
584
585      case "${HANDLE_LINK}" in
586      [dD]*)
587        rm "${COMPFILE}"
588        echo ''
589        echo "   *** Deleting ${COMPFILE}"
590        ;;
591      [lL]*)
592        echo ''
593        if [ -e "${COMPFILE#.}" ]; then
594          rm "${COMPFILE#.}"
595        fi
596        if ln "/root/${COMPFILE##*/}" "${COMPFILE#.}"; then
597          echo "   *** Link from ${COMPFILE#.} to /root/${COMPFILE##*/} installed successfully"
598          rm "${COMPFILE}"
599        else
600          echo "   *** Error linking ${COMPFILE#.} to /root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand"
601        fi
602        ;;
603      *)
604        echo "   *** ${COMPFILE} will remain for your consideration"
605        ;;
606      esac
607      DONT_INSTALL=yes
608      ;;
609    esac
610
611    case "${DONT_INSTALL}" in
612    '')
613      install -m "${FILE_MODE}" "${1}" "${INSTALL_DIR}"
614      ;;
615    *)
616      unset DONT_INSTALL
617      ;;
618    esac
619
620  else
621    install -m "${FILE_MODE}" "${1}" "${INSTALL_DIR}"
622  fi
623  return $?
624}
625
626compare_ids () {
627  case "${1}" in
628 "${2}")
629    echo " *** Temp ${COMPFILE} and installed have the same ${IDTAG}, deleting"
630    rm "${COMPFILE}"
631    ;;
632  esac
633}
634
635# Using -size +0 avoids uselessly checking the empty log files created
636# by ${SOURCEDIR}/Makefile and the device entries in ./dev, but does
637# check the scripts in ./dev, as we'd like.
638#
639for COMPFILE in `find . -type f -size +0`; do
640  case "${STRICT}" in
641  '' | [Nn][Oo])
642    # Compare CVS $Id's first so if the file hasn't been modified
643    # local changes will be ignored.
644    # If the files have the same $Id, delete the one in temproot so the
645    # user will have less to wade through if files are left to merge by hand.
646    # Take the $Id -> $FreeBSD tag change into account
647    #
648    FREEBSDID1=`grep "[$]FreeBSD:" ${COMPFILE#.} 2>/dev/null`
649    FREEBSDID2=`grep "[$]FreeBSD:" ${COMPFILE} 2>/dev/null`
650
651    if [ -n "${FREEBSDID1}" -a -n "${FREEBSDID2}" ]; then
652      IDTAG='$FreeBSD'
653      compare_ids "${FREEBSDID1}" "${FREEBSDID2}"
654    else
655      CVSID1=`grep "[$]Id:" ${COMPFILE#.} 2>/dev/null`
656      CVSID2=`grep "[$]Id:" ${COMPFILE} 2>/dev/null`
657
658      if [ -n "${CVSID1}" -a -n "${CVSID2}" ]; then
659        IDTAG='$Id'
660        compare_ids "${CVSID1}" "${CVSID2}"
661      fi
662    fi
663    ;;
664  esac
665
666  # If the file is still here either because the $Ids are different, the
667  # file doesn't have an $Id, or we're using STRICT mode; look at the diff.
668  #
669  if [ -f "${COMPFILE}" ]; then
670
671    # Do an absolute diff first to see if the files are actually different.
672    # If they're not different, delete the one in temproot.
673    #
674    if diff -q "${COMPFILE#.}" "${COMPFILE}" > /dev/null 2>&1; then
675      echo " *** Temp ${COMPFILE} and installed are the same, deleting"
676      rm "${COMPFILE}"
677    else
678      # Ok, the files are different, so show the user where they differ.  Use user's
679      # choice of diff methods; and user's pager if they have one.  Use more if not.
680      # Use unified diffs by default.  Context diffs give me a headache. :)
681      #
682      case "${AUTO_RUN}" in
683      '')
684        # prompt user to install/delete/merge changes
685        diff_loop
686        ;;
687      *)
688        # If this is an auto run, make it official
689        echo "   *** ${COMPFILE} will remain for your consideration"
690        ;;
691      esac # Auto run test
692    fi # Yes, the files are different
693  fi # Yes, the file still remains to be checked
694done # This is for the do way up there at the beginning of the comparison
695
696echo ''
697echo "*** Comparison complete"
698echo ''
699
700TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null`
701if [ -n "${TEST_FOR_FILES}" ]; then
702  echo "*** Files that remain for you to merge by hand:"
703  find "${TEMPROOT}" -type f -size +0
704fi
705
706case "${AUTO_RUN}" in
707'')
708  echo ''
709  echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] "
710  read DEL_TEMPROOT
711
712  case "${DEL_TEMPROOT}" in
713  [yY]*)
714    if rm -rf "${TEMPROOT}"; then
715      echo " *** ${TEMPROOT} has been deleted"
716    else
717      echo " *** Unable to delete ${TEMPROOT}"
718    fi
719    ;;
720  *)
721    echo " *** ${TEMPROOT} will remain"
722    ;;
723  esac
724  ;;
725*) ;;
726esac
727
728case "${NEED_MAKEDEV}" in
729'') ;;
730*)
731  echo ''
732  echo "*** You installed a new /dev/MAKEDEV script, so make sure that you run"
733  echo "    'cd /dev && /bin/sh MAKEDEV all' to rebuild your devices"
734  ;;
735esac
736
737case "${NEED_NEWALIASES}" in
738'') ;;
739*)
740  echo ''
741  echo "*** You installed a new aliases file, so make sure that you run"
742  echo "    'newaliases' to rebuild your aliases database"
743  ;;
744esac
745
746case "${NEED_CAP_MKDB}" in
747'') ;;
748*)
749  echo ''
750  echo "*** You installed a login.conf file, so make sure that you run"
751  echo "    'cap_mkdb /etc/login.conf' to rebuild your login.conf database"
752  ;;
753esac
754
755case "${NEED_PWD_MKDB}" in
756'') ;;
757*)
758  echo ''
759  echo "*** You installed a new master.passwd file, so make sure that you run"
760  echo "    'pwd_mkdb -p /etc/master.passwd' to rebuild your password files"
761  ;;
762esac
763
764echo ''
765
766exit 0
767
768