Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/website/static/security/patches/EN-13:04/freebsd-update.patch
18096 views
1
Index: usr.sbin/freebsd-update/freebsd-update.sh
2
===================================================================
3
--- usr.sbin/freebsd-update/freebsd-update.sh
4
+++ usr.sbin/freebsd-update/freebsd-update.sh
5
@@ -1200,7 +1200,7 @@
6
# Some aliases to save space later: ${P} is a character which can
7
# appear in a path; ${M} is the four numeric metadata fields; and
8
# ${H} is a sha256 hash.
9
- P="[-+./:=%@_[[:alnum:]]"
10
+ P="[-+./:=%@_[~[:alnum:]]"
11
M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+"
12
H="[0-9a-f]{64}"
13
14
@@ -2814,16 +2814,24 @@
15
16
# If we haven't already dealt with the world, deal with it.
17
if ! [ -f $1/worlddone ]; then
18
+ # Create any necessary directories first
19
+ grep -vE '^/boot/' $1/INDEX-NEW |
20
+ grep -E '^[^|]+\|d\|' > INDEX-NEW
21
+ install_from_index INDEX-NEW || return 1
22
+
23
# Install new shared libraries next
24
grep -vE '^/boot/' $1/INDEX-NEW |
25
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
26
+ grep -vE '^[^|]+\|d\|' |
27
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
28
install_from_index INDEX-NEW || return 1
29
30
# Deal with everything else
31
grep -vE '^/boot/' $1/INDEX-OLD |
32
- grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
33
+ grep -vE '^[^|]+\|d\|' |
34
+ grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD
35
grep -vE '^/boot/' $1/INDEX-NEW |
36
- grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
37
+ grep -vE '^[^|]+\|d\|' |
38
+ grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
39
install_from_index INDEX-NEW || return 1
40
install_delete INDEX-OLD INDEX-NEW || return 1
41
42
@@ -2844,11 +2852,11 @@
43
44
# Do we need to ask the user to portupgrade now?
45
grep -vE '^/boot/' $1/INDEX-NEW |
46
- grep -E '/lib/.*\.so\.[0-9]+\|' |
47
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' |
48
cut -f 1 -d '|' |
49
sort > newfiles
50
if grep -vE '^/boot/' $1/INDEX-OLD |
51
- grep -E '/lib/.*\.so\.[0-9]+\|' |
52
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' |
53
cut -f 1 -d '|' |
54
sort |
55
join -v 1 - newfiles |
56
@@ -2868,11 +2876,20 @@
57
58
# Remove old shared libraries
59
grep -vE '^/boot/' $1/INDEX-NEW |
60
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
61
+ grep -vE '^[^|]+\|d\|' |
62
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW
63
grep -vE '^/boot/' $1/INDEX-OLD |
64
- grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
65
+ grep -vE '^[^|]+\|d\|' |
66
+ grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD
67
install_delete INDEX-OLD INDEX-NEW || return 1
68
69
+ # Remove old directories
70
+ grep -vE '^/boot/' $1/INDEX-OLD |
71
+ grep -E '^[^|]+\|d\|' > INDEX-OLD
72
+ grep -vE '^/boot/' $1/INDEX-OLD |
73
+ grep -E '^[^|]+\|d\|' > INDEX-OLD
74
+ install_delete INDEX-OLD INDEX-NEW || return 1
75
+
76
# Remove temporary files
77
rm INDEX-OLD INDEX-NEW
78
}
79
80