Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142355124
D41945.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41945.id.diff
View Options
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -2894,6 +2894,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
@@ -2914,6 +2923,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}
@@ -2926,6 +2936,7 @@
fi
;;
L)
+ dir_conflict "${BASEDIR}/${FPATH}"
# Create a symlink
ln -sfh ${HASH} ${BASEDIR}/${FPATH}
;;
@@ -2962,10 +2973,14 @@
rmdir ${BASEDIR}/${FPATH}
;;
f)
- rm ${BASEDIR}/${FPATH}
+ if [ -f "${BASEDIR}/${FPATH}" ]; then
+ rm "${BASEDIR}/${FPATH}"
+ fi
;;
L)
- rm ${BASEDIR}/${FPATH}
+ if [ -L "${BASEDIR}/${FPATH}" ]; then
+ rm "${BASEDIR}/${FPATH}"
+ fi
;;
esac
done < killfiles
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 11:43 PM (2 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27754371
Default Alt Text
D41945.id.diff (1 KB)
Attached To
Mode
D41945: freebsd-update: handle directories changing to files, too
Attached
Detach File
Event Timeline
Log In to Comment