Deleted Added
full compact
mergemaster.sh (77326) mergemaster.sh (77335)
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-2001 Douglas Barton
9# DougB@FreeBSD.org
10
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-2001 Douglas Barton
9# DougB@FreeBSD.org
10
11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 77326 2001-05-28 09:46:18Z dougb $
11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 77335 2001-05-28 13:17:20Z dougb $
12
13PATH=/bin:/usr/bin:/usr/sbin
14
15display_usage () {
16 VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
17 echo "mergemaster version ${VERSION_NUMBER}"
18 echo 'Usage: mergemaster [-scrvahi] [-m /path]'
19 echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]'

--- 483 unchanged lines hidden (view full) ---

503# Get ready to start comparing files
504
505# Check umask if not specified on the command line,
506# and we are not doing an autorun
507#
508if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then
509 USER_UMASK=`umask`
510 case "${USER_UMASK}" in
12
13PATH=/bin:/usr/bin:/usr/sbin
14
15display_usage () {
16 VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
17 echo "mergemaster version ${VERSION_NUMBER}"
18 echo 'Usage: mergemaster [-scrvahi] [-m /path]'
19 echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]'

--- 483 unchanged lines hidden (view full) ---

503# Get ready to start comparing files
504
505# Check umask if not specified on the command line,
506# and we are not doing an autorun
507#
508if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then
509 USER_UMASK=`umask`
510 case "${USER_UMASK}" in
511 0022) ;;
511 0022|022) ;;
512 *)
513 echo ''
514 echo " *** Your umask is currently set to ${USER_UMASK}. By default, this script"
515 echo " installs all files with the same user, group and modes that"
516 echo " they are created with by ${SOURCEDIR}/Makefile, compared to"
517 echo " a umask of 022. This umask allows world read permission when"
518 echo " the file's default permissions have it."
519 echo " No world permissions can sometimes cause problems. A umask of"

--- 76 unchanged lines hidden (view full) ---

596 NEED_CAP_MKDB=yes
597 ;;
598 /etc/master.passwd)
599 install -m 600 "${1}" "${DESTDIR}${INSTALL_DIR}"
600 NEED_PWD_MKDB=yes
601 DONT_INSTALL=yes
602 ;;
603 /.cshrc | /.profile)
512 *)
513 echo ''
514 echo " *** Your umask is currently set to ${USER_UMASK}. By default, this script"
515 echo " installs all files with the same user, group and modes that"
516 echo " they are created with by ${SOURCEDIR}/Makefile, compared to"
517 echo " a umask of 022. This umask allows world read permission when"
518 echo " the file's default permissions have it."
519 echo " No world permissions can sometimes cause problems. A umask of"

--- 76 unchanged lines hidden (view full) ---

596 NEED_CAP_MKDB=yes
597 ;;
598 /etc/master.passwd)
599 install -m 600 "${1}" "${DESTDIR}${INSTALL_DIR}"
600 NEED_PWD_MKDB=yes
601 DONT_INSTALL=yes
602 ;;
603 /.cshrc | /.profile)
604 case "${AUTO_INSTALL}" in
605 '')
604 case "${LINK_EXPLAINED}" in
605 '')
606 echo " *** Historically BSD derived systems have had a"
607 echo " hard link from /.cshrc and /.profile to"
608 echo " their namesakes in /root. Please indicate"
609 echo " your preference below for bringing your"
610 echo " installed files up to date."
611 echo ''
612 LINK_EXPLAINED=yes
613 ;;
614 esac
615
616 echo " Use 'd' to delete the temporary ${COMPFILE}"
617 echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link"
618 echo ''
619 echo " Default is to leave the temporary file to deal with by hand"
620 echo ''
621 echo -n " How should I handle ${COMPFILE}? [Leave it to install later] "
622 read HANDLE_LINK
606 case "${LINK_EXPLAINED}" in
607 '')
608 echo " *** Historically BSD derived systems have had a"
609 echo " hard link from /.cshrc and /.profile to"
610 echo " their namesakes in /root. Please indicate"
611 echo " your preference below for bringing your"
612 echo " installed files up to date."
613 echo ''
614 LINK_EXPLAINED=yes
615 ;;
616 esac
617
618 echo " Use 'd' to delete the temporary ${COMPFILE}"
619 echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link"
620 echo ''
621 echo " Default is to leave the temporary file to deal with by hand"
622 echo ''
623 echo -n " How should I handle ${COMPFILE}? [Leave it to install later] "
624 read HANDLE_LINK
625 ;;
626 *) # Part of AUTO_INSTALL
627 HANDLE_LINK=l
628 ;;
629 esac
623
624 case "${HANDLE_LINK}" in
625 [dD]*)
626 rm "${COMPFILE}"
627 echo ''
628 echo " *** Deleting ${COMPFILE}"
629 ;;
630 [lL]*)

--- 125 unchanged lines hidden (view full) ---

756echo ''
757echo "*** Comparison complete"
758echo ''
759
760TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null`
761if [ -n "${TEST_FOR_FILES}" ]; then
762 echo "*** Files that remain for you to merge by hand:"
763 find "${TEMPROOT}" -type f -size +0
630
631 case "${HANDLE_LINK}" in
632 [dD]*)
633 rm "${COMPFILE}"
634 echo ''
635 echo " *** Deleting ${COMPFILE}"
636 ;;
637 [lL]*)

--- 125 unchanged lines hidden (view full) ---

763echo ''
764echo "*** Comparison complete"
765echo ''
766
767TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null`
768if [ -n "${TEST_FOR_FILES}" ]; then
769 echo "*** Files that remain for you to merge by hand:"
770 find "${TEMPROOT}" -type f -size +0
771 echo ''
764fi
765
766case "${AUTO_RUN}" in
767'')
772fi
773
774case "${AUTO_RUN}" in
775'')
768 echo ''
769 echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] "
770 read DEL_TEMPROOT
771
772 case "${DEL_TEMPROOT}" in
773 [yY]*)
774 if rm -rf "${TEMPROOT}"; then
775 echo " *** ${TEMPROOT} has been deleted"
776 else

--- 30 unchanged lines hidden (view full) ---

807 ;;
808esac
809
810run_it_now () {
811 case "${AUTO_RUN}" in
812 '')
813 unset YES_OR_NO
814 echo ''
776 echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] "
777 read DEL_TEMPROOT
778
779 case "${DEL_TEMPROOT}" in
780 [yY]*)
781 if rm -rf "${TEMPROOT}"; then
782 echo " *** ${TEMPROOT} has been deleted"
783 else

--- 30 unchanged lines hidden (view full) ---

814 ;;
815esac
816
817run_it_now () {
818 case "${AUTO_RUN}" in
819 '')
820 unset YES_OR_NO
821 echo ''
815 echo -n ' Would you like to run it now? [y or n] '
822 echo -n ' Would you like to run it now? y or n [n] '
816 read YES_OR_NO
817
823 read YES_OR_NO
824
818 echo ''
819
820 case "${YES_OR_NO}" in
821 y)
825 case "${YES_OR_NO}" in
826 y)
822 echo " Running ${1}"
827 echo " Running ${1}"
828 echo ''
823 eval "${1}"
824 ;;
829 eval "${1}"
830 ;;
825 *)
826 echo " Make sure to run ${1} yourself"
831 ''|n)
832 echo ''
833 echo " *** Cancelled"
834 echo ''
835 echo " Make sure to run ${1} yourself"
827 ;;
836 ;;
837 *)
838 echo ''
839 echo " *** Sorry, I do not understand your answer (${YES_OR_NO})"
840 echo ''
841 echo " Make sure to run ${1} yourself"
828 esac
829 ;;
830 *) ;;
831 esac
832}
833
834case "${NEED_MAKEDEV}" in
835'') ;;
836*)
837 echo ''
842 esac
843 ;;
844 *) ;;
845 esac
846}
847
848case "${NEED_MAKEDEV}" in
849'') ;;
850*)
851 echo ''
838 echo "*** You installed a new /dev/MAKEDEV script, so make sure that you run"
839 echo " 'cd /dev && /bin/sh MAKEDEV all' to rebuild your devices"
840 run_it_now 'cd /dev && /bin/sh MAKEDEV all'
852 echo "*** You installed a new ${DESTDIR}/dev/MAKEDEV script, so make sure that you run"
853 echo " 'cd ${DESTDIR}/dev && /bin/sh MAKEDEV all' to rebuild your devices"
854 run_it_now "cd ${DESTDIR}/dev && /bin/sh MAKEDEV all"
841 ;;
842esac
843
844case "${NEED_NEWALIASES}" in
845'') ;;
846*)
847 echo ''
855 ;;
856esac
857
858case "${NEED_NEWALIASES}" in
859'') ;;
860*)
861 echo ''
848 echo "*** You installed a new aliases file, so make sure that you run"
849 echo " '/usr/bin/newaliases' to rebuild your aliases database"
850 run_it_now '/usr/bin/newaliases'
862 if [ -n "${DESTDIR}" ]; then
863 echo "*** You installed a new aliases file into ${DESTDIR}/etc/mail, but"
864 echo " the newaliases command is limited to the directories configured"
865 echo " in sendmail.cf. Make sure to create your aliases database by"
866 echo " hand when your sendmail configuration is done."
867 else
868 echo "*** You installed a new aliases file, so make sure that you run"
869 echo " '/usr/bin/newaliases' to rebuild your aliases database"
870 run_it_now '/usr/bin/newaliases'
871 fi
851 ;;
852esac
853
854case "${NEED_CAP_MKDB}" in
855'') ;;
856*)
857 echo ''
858 echo "*** You installed a login.conf file, so make sure that you run"
872 ;;
873esac
874
875case "${NEED_CAP_MKDB}" in
876'') ;;
877*)
878 echo ''
879 echo "*** You installed a login.conf file, so make sure that you run"
859 echo " '/usr/bin/cap_mkdb /etc/login.conf' to rebuild your login.conf database"
860 run_it_now '/usr/bin/cap_mkdb /etc/login.conf'
880 echo " '/usr/bin/cap_mkdb ${DESTDIR}/etc/login.conf'"
881 echo " to rebuild your login.conf database"
882 run_it_now "/usr/bin/cap_mkdb ${DESTDIR}/etc/login.conf"
861 ;;
862esac
863
864case "${NEED_PWD_MKDB}" in
865'') ;;
866*)
867 echo ''
868 echo "*** You installed a new master.passwd file, so make sure that you run"
883 ;;
884esac
885
886case "${NEED_PWD_MKDB}" in
887'') ;;
888*)
889 echo ''
890 echo "*** You installed a new master.passwd file, so make sure that you run"
869 echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd' to rebuild your password files"
870 run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd'
891 if [ -n "${DESTDIR}" ]; then
892 echo " '/usr/sbin/pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd'"
893 echo " to rebuild your password files"
894 run_it_now "/usr/sbin/pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd"
895 else
896 echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'"
897 echo " to rebuild your password files"
898 run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd'
899 fi
871 ;;
872esac
873
874echo ''
875
876if [ -r "${MM_EXIT_SCRIPT}" ]; then
877 . "${MM_EXIT_SCRIPT}"
878fi
879
880exit 0
881
900 ;;
901esac
902
903echo ''
904
905if [ -r "${MM_EXIT_SCRIPT}" ]; then
906 . "${MM_EXIT_SCRIPT}"
907fi
908
909exit 0
910