diff options
author | dougb <dougb@FreeBSD.org> | 2001-05-30 08:50:10 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2001-05-30 08:50:10 +0000 |
commit | 4783026083576dc9b63a6c30a4c8391ef64c7093 (patch) | |
tree | 7f03cb774433f8978f52a2e214b56accef06dacc /usr.sbin/mergemaster/mergemaster.sh | |
parent | a0556cd83cd3f2b3be8a406f63579d8861886be5 (diff) | |
download | FreeBSD-src-4783026083576dc9b63a6c30a4c8391ef64c7093.zip FreeBSD-src-4783026083576dc9b63a6c30a4c8391ef64c7093.tar.gz |
Add the last of the compatibility mods from openbsd. Neatly, the
"install && rm" change fits in with the new FreeBSD default of
copy instead of move for install. Changing the order of the deletion
of the spurious password files doesn't affect FreeBSD functionality,
but it's done in such a way as not to matter.
Obtained from: Christian Weisgerber <naddy@mips.inka.de>
Diffstat (limited to 'usr.sbin/mergemaster/mergemaster.sh')
-rwxr-xr-x | usr.sbin/mergemaster/mergemaster.sh | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh index 00ff09b..8dde227 100755 --- a/usr.sbin/mergemaster/mergemaster.sh +++ b/usr.sbin/mergemaster/mergemaster.sh @@ -479,12 +479,6 @@ case "${RERUN}" in ;; esac - # We really don't want to have to deal with these files, since - # master.passwd is the real file that should be compared, then - # the user should run pwd_mkdb if necessary. - # - rm ${TEMPROOT}/etc/spwd.db ${TEMPROOT}/etc/passwd ${TEMPROOT}/etc/pwd.db - # Avoid comparing the motd if the user specifies it in .mergemasterrc case "${IGNORE_MOTD}" in '') ;; @@ -500,6 +494,14 @@ case "${RERUN}" in ;; # End of the "RERUN" test esac +# We really don't want to have to deal with these files, since +# master.passwd is the real file that should be compared, then +# the user should run pwd_mkdb if necessary. +# +[ -f "${TEMPROOT}/etc/spwd.db" ] && rm "${TEMPROOT}/etc/spwd.db" +[ -f "${TEMPROOT}/etc/passwd" ] && rm "${TEMPROOT}/etc/passwd" +[ -f "${TEMPROOT}/etc/pwd.db" ] && rm "${TEMPROOT}/etc/pwd.db" + # Get ready to start comparing files # Check umask if not specified on the command line, @@ -596,7 +598,8 @@ mm_install () { NEED_CAP_MKDB=yes ;; /etc/master.passwd) - install -m 600 "${1}" "${DESTDIR}${INSTALL_DIR}" + install -m 600 "${1}" "${DESTDIR}${INSTALL_DIR}" && + [ -f "${1}" ] && rm "${1}" NEED_PWD_MKDB=yes DONT_INSTALL=yes ;; @@ -654,7 +657,8 @@ mm_install () { case "${DONT_INSTALL}" in '') - install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" && + [ -f "${1}" ] && rm "${1}" ;; *) unset DONT_INSTALL @@ -666,7 +670,8 @@ mm_install () { NEED_MAKEDEV=yes ;; esac - install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" && + [ -f "${1}" ] && rm "${1}" fi return $? } |