summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mergemaster/mergemaster.sh
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2001-06-20 07:15:38 +0000
committerdougb <dougb@FreeBSD.org>2001-06-20 07:15:38 +0000
commit9f7dbbc5e360447f2f66edcb39f1a20c6314e738 (patch)
tree4a8d3e565c3ae5267d02c02d548087bedb581fa8 /usr.sbin/mergemaster/mergemaster.sh
parente0ae24c6001de55753b25e4ba890b8acbb9461b9 (diff)
downloadFreeBSD-src-9f7dbbc5e360447f2f66edcb39f1a20c6314e738.zip
FreeBSD-src-9f7dbbc5e360447f2f66edcb39f1a20c6314e738.tar.gz
Work around the problem in RELENG_4 where the file doesn't actually
exist, and therefore mm_install is returning the "fail" value of the test instead of the "success" value for install. This change is a no-op on HEAD, but since the only harm on RELENG_4 ATM is a spurious warning it can follow the usual MFC practice. Submitted by: A cast of thousands :-/
Diffstat (limited to 'usr.sbin/mergemaster/mergemaster.sh')
-rwxr-xr-xusr.sbin/mergemaster/mergemaster.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh
index 8dde227..8efbae7 100755
--- a/usr.sbin/mergemaster/mergemaster.sh
+++ b/usr.sbin/mergemaster/mergemaster.sh
@@ -569,6 +569,15 @@ fi
# Use the umask/mode information to install the files
# Create directories as needed
#
+do_install_and_rm () {
+ install -m "${1}" "${2}" "${3}" &&
+ if [ -f "${2}" ]; then
+ rm "${2}"
+ else
+ return 0
+ fi
+}
+
mm_install () {
local INSTALL_DIR
INSTALL_DIR=${1#.}
@@ -598,8 +607,7 @@ mm_install () {
NEED_CAP_MKDB=yes
;;
/etc/master.passwd)
- install -m 600 "${1}" "${DESTDIR}${INSTALL_DIR}" &&
- [ -f "${1}" ] && rm "${1}"
+ do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}"
NEED_PWD_MKDB=yes
DONT_INSTALL=yes
;;
@@ -657,21 +665,19 @@ mm_install () {
case "${DONT_INSTALL}" in
'')
- install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" &&
- [ -f "${1}" ] && rm "${1}"
+ do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
;;
*)
unset DONT_INSTALL
;;
esac
- else
+ else # File matched -x
case "${1#.}" in
/dev/MAKEDEV)
NEED_MAKEDEV=yes
;;
esac
- install -m "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" &&
- [ -f "${1}" ] && rm "${1}"
+ do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
fi
return $?
}
OpenPOWER on IntegriCloud