aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 9cdff05c24e4..b9b277cca1c8 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -2903,7 +2903,13 @@ install_from_index () {
while read FPATH TYPE OWNER GROUP PERM FLAGS HASH LINK; do
case ${TYPE} in
d)
- # Create a directory
+ # Create a directory. A file may change to a directory
+ # on upgrade (PR273661). If that happens, remove the
+ # file first.
+ if [ -e "${BASEDIR}/${FPATH}" ] && \
+ ! [ -d "${BASEDIR}/${FPATH}" ]; then
+ rm -f -- "${BASEDIR}/${FPATH}"
+ fi
install -d -o ${OWNER} -g ${GROUP} \
-m ${PERM} ${BASEDIR}/${FPATH}
;;