Commit 0a56401
Sergio Durigan Junior
Improve wcurl version comparison mechanism
We've been having a some problems with version comparison in the
script. The approach we've taken so far is to decompose the current
curl version into two variables (major and minor), and then perform
comparisons against these components separately. It works, but it's
confusing.
Another possible approach would be to use a C-style version
normalization (basically a printf "%02d%02d") and then perform
comparisons against the versions we want. The problem is that these
versions need also to be normalized, which can be confusing as well.
I decided to implement the second approach but abstract it as a simple
function that can take a regular version string like "8.16" as well as
a comparison operator that will then be passed onto to "test". This
reads much nicer and abstracts the complexities of version
normalization away. Unfortunately due to the limitations of shell
scripting it's not easy to deduplicate code in this scenario, but that
should be OK for now.
Signed-off-by: Sergio Durigan Junior <[email protected]>1 parent df07f13 commit 0a56401
1 file changed
+51
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
133 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
134 | 159 | | |
135 | 160 | | |
136 | 161 | | |
| |||
198 | 223 | | |
199 | 224 | | |
200 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
201 | 241 | | |
202 | 242 | | |
203 | 243 | | |
204 | 244 | | |
205 | 245 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | 246 | | |
212 | 247 | | |
213 | 248 | | |
214 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
215 | 255 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
231 | 260 | | |
232 | 261 | | |
233 | 262 | | |
| |||
0 commit comments