Lines 71-122
Link Here
|
71 |
|
71 |
|
72 |
sd_hardware=`uname -p` |
72 |
sd_hardware=`uname -p` |
73 |
sd_release=`uname -r` |
73 |
sd_release=`uname -r` |
74 |
required_patch= |
74 |
required_patches= |
75 |
|
75 |
|
76 |
case $sd_hardware in |
76 |
case $sd_hardware in |
77 |
i386) |
77 |
i386) |
78 |
case $sd_release in |
78 |
case $sd_release in |
79 |
5.6) |
79 |
5.6) |
80 |
required_patch=104678 |
80 |
required_patches="SUNWlibC 104678-07" |
81 |
required_minor=7 |
81 |
;; |
82 |
;; |
|
|
83 |
5.7) |
82 |
5.7) |
84 |
required_patch=106328 |
83 |
required_patches="SUNWlibC 106328-08" |
85 |
required_minor=8 |
|
|
86 |
;; |
84 |
;; |
87 |
5.8) |
85 |
5.8) |
88 |
required_patch=108436 |
86 |
required_patches="SUNWlibC 108436-01 SUNWxwplt 108653-46 SUNWxi18n opt 108774-12" |
89 |
required_minor=1 |
87 |
;; |
90 |
;; |
|
|
91 |
esac |
88 |
esac |
92 |
;; |
89 |
;; |
93 |
sparc) |
90 |
sparc) |
94 |
case $sd_release in |
91 |
case $sd_release in |
95 |
5.6) |
92 |
5.6) |
96 |
required_patch=105591 |
93 |
required_patches="SUNWlibC 105591-09" |
97 |
required_minor=9 |
94 |
;; |
98 |
;; |
95 |
5.7) |
99 |
5.7) |
96 |
required_patches="SUNWlibC 106327-08 SUNWlibCx opt 106300-09" |
100 |
required_patch=106327 |
97 |
;; |
101 |
required_minor=8 |
98 |
5.8) |
102 |
;; |
99 |
required_patches="SUNWlibC 108434-01 SUNWlibCx opt 108435-01 SUNWxwplt 108652-56 SUNWxi18n opt 108773-12" |
103 |
5.8) |
100 |
;; |
104 |
required_patch=108434 |
|
|
105 |
required_minor=1 |
106 |
;; |
107 |
esac |
101 |
esac |
108 |
esac |
102 |
esac |
109 |
|
103 |
|
110 |
if [ "$ignore_patch_check" != "" ]; then |
104 |
if [ "$ignore_patch_check" != "" ]; then |
111 |
echo WARNING! overriding patch check! |
105 |
echo WARNING! overriding patch check! |
112 |
required_patch= |
106 |
required_patches= |
113 |
fi |
107 |
fi |
114 |
|
108 |
|
115 |
# |
109 |
# |
116 |
# if no patch is required we are done |
110 |
# if no patch is required we are done |
117 |
# |
111 |
# |
118 |
|
112 |
|
119 |
if [ "$required_patch" = "" ]; then |
113 |
if [ "$required_patches" = "" ]; then |
120 |
exit 0 |
114 |
exit 0 |
121 |
fi |
115 |
fi |
122 |
|
116 |
|
Lines 124-169
Link Here
|
124 |
# check prerequesites |
118 |
# check prerequesites |
125 |
# |
119 |
# |
126 |
|
120 |
|
127 |
if [ ! -x /usr/bin/awk ]; then |
121 |
if [ ! -x /usr/bin/nawk ]; then |
128 |
exit 0 |
122 |
exit 0 |
129 |
fi |
123 |
fi |
130 |
|
124 |
|
131 |
# |
125 |
# |
132 |
# check installed patches |
126 |
# check installed patches |
133 |
# |
127 |
# |
134 |
patch_installed=`"$sd_inst"/sorev -l SUNWlibC | /usr/bin/awk \ |
128 |
set -- $required_patches |
135 |
'{ \ |
|
|
136 |
if ($1 == "Patch:") { \ |
137 |
split($2, inst_patch, "-"); \ |
138 |
if (inst_patch[1] == required_patch) { \ |
139 |
if ((inst_patch[2]+1) >= (1+required_minor)){ \ |
140 |
print "done"; exit 0; \ |
141 |
} \ |
142 |
} \ |
143 |
} \ |
144 |
if ($3 == "Obsoletes:") { \ |
145 |
split($4, inst_patch, "-"); \ |
146 |
if (inst_patch[1] == required_patch) { \ |
147 |
if ((inst_patch[2]+1) >= (1+required_minor)){ \ |
148 |
print "done"; exit 0; \ |
149 |
} \ |
150 |
} \ |
151 |
} \ |
152 |
}' required_patch=$required_patch required_minor=$required_minor ` |
153 |
|
129 |
|
154 |
if [ "$patch_installed" = "done" ]; then |
130 |
while [ $# -ge 2 ]; do |
155 |
exit 0 |
131 |
|
156 |
else |
132 |
package=$1 |
157 |
case $sd_hardware in |
133 |
if [ "$2" = opt ]; then |
158 |
i386) |
134 |
package_optional=YES |
159 |
echo "Operating system update required. Please install the following patches. Solaris 7: 106328-08; Solaris 8: 108436-01, 108774-12" |
135 |
patch=$3 |
160 |
;; |
136 |
shift 3 |
161 |
sparc) |
137 |
else |
162 |
echo "Operating system update required. Please install the following patches. Solaris 7: 106327-08, 106300-09 (64 bit only); Solaris 8: 108434-01, 108773-12, 108435-01 (64 bit only)" |
138 |
package_optional=NO |
|
|
139 |
patch=$2 |
140 |
shift 2 |
141 |
fi |
142 |
|
143 |
if [ $package_optional = YES -a ! -d /var/sadm/pkg/$package ]; then |
144 |
# |
145 |
# An optional package, that is not installed at all. |
146 |
# No need to check installed patches for this package. |
147 |
# |
148 |
continue |
149 |
fi |
150 |
|
151 |
patch_installed=`"$sd_inst"/sorev -l $package | /usr/bin/nawk -v patch=$patch \ |
152 |
'BEGIN { |
153 |
split(patch, tmp, "-"); |
154 |
required_patch=tmp[1]; |
155 |
required_minor=tmp[2]; |
156 |
} |
157 |
|
158 |
{ |
159 |
if ($1 == "Patch:") { |
160 |
split($2, inst_patch, "-"); |
161 |
if (inst_patch[1] == required_patch) { |
162 |
if ((inst_patch[2]+1) >= (1+required_minor)){ |
163 |
print "done"; exit 0; |
164 |
} |
165 |
} |
166 |
} |
167 |
if ($3 == "Obsoletes:") { |
168 |
split($4, inst_patch, "-"); |
169 |
if (inst_patch[1] == required_patch) { |
170 |
if ((inst_patch[2]+1) >= (1+required_minor)){ |
171 |
print "done"; exit 0; |
172 |
} |
173 |
} |
174 |
} |
175 |
}'` |
176 |
|
177 |
if [ "$patch_installed" != "done" ]; then |
178 |
echo "Required patch $patch (or newer) for package $package is not installed" |
179 |
|
180 |
case $sd_hardware in |
181 |
i386) |
182 |
echo "Operating system update required. Please install the following patches. Solaris 7: 106328-08; Solaris 8: 108436-01, 108774-12, 108653-46" |
163 |
;; |
183 |
;; |
164 |
esac |
184 |
sparc) |
165 |
exit 1 |
185 |
echo "Operating system update required. Please install the following patches. Solaris 7: 106327-08, 106300-09 (64 bit only); Solaris 8: 108434-01, 108773-12, 108652-56, 108435-01 (64 bit only)" |
166 |
fi |
186 |
;; |
|
|
187 |
esac |
188 |
exit 1 |
189 |
fi |
190 |
done |
191 |
|
192 |
exit 0 |
167 |
fi |
193 |
fi |
168 |
|
194 |
|
169 |
exit 0 |
195 |
exit 0 |