aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/freebsd-update
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
commit3b8f08459569bf0faa21473e5cec2491e95c9349 (patch)
tree80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.sbin/freebsd-update
parent9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff)
parentb2ba55951383498f252746f618d513139da06e8e (diff)
downloadsrc-3b8f08459569bf0faa21473e5cec2491e95c9349.tar.gz
src-3b8f08459569bf0faa21473e5cec2491e95c9349.zip
Merge head
Notes
Notes: svn path=/projects/bmake/; revision=265044
Diffstat (limited to 'usr.sbin/freebsd-update')
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh50
1 files changed, 27 insertions, 23 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index ea4099a0a688..ee702e3a4f71 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -1200,7 +1200,7 @@ fetch_metadata_sanity () {
# Some aliases to save space later: ${P} is a character which can
# appear in a path; ${M} is the four numeric metadata fields; and
# ${H} is a sha256 hash.
- P="[-+./:=%@_[[:alnum:]]"
+ P="[-+./:=%@_[~[:alnum:]]"
M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+"
H="[0-9a-f]{64}"
@@ -2814,16 +2814,24 @@ Kernel updates have been installed. Please reboot and run
# If we haven't already dealt with the world, deal with it.
if ! [ -f $1/worlddone ]; then
+ # Create any necessary directories first
+ grep -vE '^/boot/' $1/INDEX-NEW |
+ grep -E '^[^|]+\|d\|' > INDEX-NEW
+ install_from_index INDEX-NEW || return 1
+
# Install new shared libraries next
grep -vE '^/boot/' $1/INDEX-NEW |
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
+ grep -vE '^[^|]+\|d\|' |
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
# Deal with everything else
grep -vE '^/boot/' $1/INDEX-OLD |
- grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
+ grep -vE '^[^|]+\|d\|' |
+ grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
- grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
+ grep -vE '^[^|]+\|d\|' |
+ grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
install_delete INDEX-OLD INDEX-NEW || return 1
@@ -2844,11 +2852,11 @@ Kernel updates have been installed. Please reboot and run
# Do we need to ask the user to portupgrade now?
grep -vE '^/boot/' $1/INDEX-NEW |
- grep -E '/lib/.*\.so\.[0-9]+\|' |
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' |
cut -f 1 -d '|' |
sort > newfiles
if grep -vE '^/boot/' $1/INDEX-OLD |
- grep -E '/lib/.*\.so\.[0-9]+\|' |
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' |
cut -f 1 -d '|' |
sort |
join -v 1 - newfiles |
@@ -2868,9 +2876,18 @@ again to finish installing updates.
# Remove old shared libraries
grep -vE '^/boot/' $1/INDEX-NEW |
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
+ grep -vE '^[^|]+\|d\|' |
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
grep -vE '^/boot/' $1/INDEX-OLD |
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
+ grep -vE '^[^|]+\|d\|' |
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD
+ install_delete INDEX-OLD INDEX-NEW || return 1
+
+ # Remove old directories
+ grep -vE '^/boot/' $1/INDEX-NEW |
+ grep -E '^[^|]+\|d\|' > INDEX-NEW
+ grep -vE '^/boot/' $1/INDEX-OLD |
+ grep -E '^[^|]+\|d\|' > INDEX-OLD
install_delete INDEX-OLD INDEX-NEW || return 1
# Remove temporary files
@@ -3033,21 +3050,8 @@ IDS_compare () {
mv INDEX-NOTMATCHING.tmp INDEX-NOTMATCHING
# Go through the lines and print warnings.
- while read LINE; do
- FPATH=`echo "${LINE}" | cut -f 1 -d '|'`
- TYPE=`echo "${LINE}" | cut -f 2 -d '|'`
- OWNER=`echo "${LINE}" | cut -f 3 -d '|'`
- GROUP=`echo "${LINE}" | cut -f 4 -d '|'`
- PERM=`echo "${LINE}" | cut -f 5 -d '|'`
- HASH=`echo "${LINE}" | cut -f 6 -d '|'`
- LINK=`echo "${LINE}" | cut -f 7 -d '|'`
- P_TYPE=`echo "${LINE}" | cut -f 8 -d '|'`
- P_OWNER=`echo "${LINE}" | cut -f 9 -d '|'`
- P_GROUP=`echo "${LINE}" | cut -f 10 -d '|'`
- P_PERM=`echo "${LINE}" | cut -f 11 -d '|'`
- P_HASH=`echo "${LINE}" | cut -f 12 -d '|'`
- P_LINK=`echo "${LINE}" | cut -f 13 -d '|'`
-
+ local IFS='|'
+ while read FPATH TYPE OWNER GROUP PERM HASH LINK P_TYPE P_OWNER P_GROUP P_PERM P_HASH P_LINK; do
# Warn about different object types.
if ! [ "${TYPE}" = "${P_TYPE}" ]; then
echo -n "${FPATH} is a "