Page MenuHomeFreeBSD

D41945.id127880.diff
No OneTemporary

D41945.id127880.diff

Index: usr.sbin/freebsd-update/freebsd-update.sh
===================================================================
--- usr.sbin/freebsd-update/freebsd-update.sh
+++ usr.sbin/freebsd-update/freebsd-update.sh
@@ -2900,6 +2900,15 @@
set +f
}
+# Check for and remove an existing directory that conflicts with the file or
+# symlink that we are going to install.
+dir_conflict () {
+ if [ -d "$1" ]; then
+ echo "Removing conflicting directory $1"
+ rm -rf -- "$1"
+ fi
+}
+
# Install new files
install_from_index () {
# First pass: Do everything apart from setting file flags. We
@@ -2920,6 +2929,7 @@
-m ${PERM} ${BASEDIR}/${FPATH}
;;
f)
+ dir_conflict "${BASEDIR}/${FPATH}"
if [ -z "${LINK}" ]; then
# Create a file, without setting flags.
gunzip < files/${HASH}.gz > ${HASH}
@@ -2932,6 +2942,7 @@
fi
;;
L)
+ dir_conflict "${BASEDIR}/${FPATH}"
# Create a symlink
ln -sfh ${HASH} ${BASEDIR}/${FPATH}
;;
@@ -2967,11 +2978,8 @@
d)
rmdir ${BASEDIR}/${FPATH}
;;
- f)
- rm ${BASEDIR}/${FPATH}
- ;;
- L)
- rm ${BASEDIR}/${FPATH}
+ f|L)
+ rm -f "${BASEDIR}/${FPATH}"
;;
esac
done < killfiles

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 22, 9:00 AM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27838425
Default Alt Text
D41945.id127880.diff (1 KB)

Event Timeline