@@ -153,6 +153,7 @@ cat <<EOF
153
153
{
154
154
"name": "libressl",
155
155
"url": "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-{ver}.tar.gz",
156
+ "curlopt": "--ipv4",
156
157
"sig": ".asc",
157
158
"keys": "A1EB079B8D3EB92B4EBD3139663AF51BD5E4D8D5"
158
159
},
@@ -265,11 +266,14 @@ to8digit() {
265
266
}
266
267
267
268
check_update () {
268
- local pkg url ourvern newver newvern slug mask urldir res
269
+ local pkg url ourvern newver newvern slug mask urldir res curlopt
269
270
pkg=" $1 "
270
271
ourvern=" ${2:- 000000} "
271
272
url=" $3 "
272
273
newver=' '
274
+ curlopt=" ${10} "
275
+ options=()
276
+ [ -n " ${curlopt} " ] && options+=(" ${curlopt} " )
273
277
if [[ " ${url} " =~ ^https://github.com/([a-zA-Z0-9-]+/[a-zA-Z0-9-]+)/ ]]; then
274
278
slug=" ${BASH_REMATCH[1]} "
275
279
if [ -n " $7 " ]; then
@@ -325,7 +329,7 @@ check_update() {
325
329
# a separate subdirectory.
326
330
if [ " ${pkg} " = ' libssh' ]; then
327
331
# ugly hack: repurpose 'ref_url' for this case:
328
- res=" $( my_curl " $7 " | hxclean | hxselect -i -c -s ' \n' ' a::attr(href)' \
332
+ res=" $( my_curl " ${options[@]} " " $ 7" | hxclean | hxselect -i -c -s ' \n' ' a::attr(href)' \
329
333
| grep -a -o -E -- ' [0-9.]+' | " ${latest} " -1) "
330
334
url=" $7 ${res} "
331
335
urldir=" ${url} /"
@@ -338,7 +342,7 @@ check_update() {
338
342
mask=" ${pkg} [._-]v?([0-9]+(\.[0-9]+)+)\.t"
339
343
[ -n " $9 " ] && mask=" $9 "
340
344
# >&2 echo "mask|${mask}|"
341
- res=" $( my_curl " ${urldir} " | hxclean | hxselect -i -c -s ' \n' ' a::attr(href)' \
345
+ res=" $( my_curl " ${options[@]} " " ${ urldir}" | hxclean | hxselect -i -c -s ' \n' ' a::attr(href)' \
342
346
| grep -a -o -E -- " ${mask} " | " ${latest} " -1) "
343
347
# >&2 echo "res|${res}|"
344
348
if [[ " ${res} " =~ ${mask} ]]; then
@@ -360,13 +364,15 @@ check_update() {
360
364
}
361
365
362
366
check_dl () {
363
- local name url keys sig sha options key ok hash_calc hash_got
367
+ local name url keys sig sha options key ok hash_calc hash_got curlopt
364
368
name=" $1 "
365
369
url=" $2 "
366
370
sig=" $3 "
367
371
sha=" $4 "
368
372
keys=" $6 "
373
+ curlopt=" $7 "
369
374
options=()
375
+ [ -n " ${curlopt} " ] && options+=(" ${curlopt} " )
370
376
[ " $5 " = ' redir' ] && options+=(--location --proto-redir ' =https' )
371
377
options+=(--output pkg.bin " ${url} " )
372
378
if [ -n " ${sig} " ]; then
@@ -463,6 +469,7 @@ bump() {
463
469
ref_url=" $( printf ' %s' " ${jp} " | jq --raw-output ' .ref_url' | sed ' s/^null$//' ) "
464
470
ref_expr=" $( printf ' %s' " ${jp} " | jq --raw-output ' .ref_expr' | sed ' s/^null$//' ) "
465
471
ref_mask=" $( printf ' %s' " ${jp} " | jq --raw-output ' .ref_mask' | sed ' s/^null$//' ) "
472
+ curlopt=" $( printf ' %s' " ${jp} " | jq --raw-output ' .curlopt' | sed ' s/^null$//' ) "
466
473
467
474
if [ " ${pin} " = ' true' ]; then
468
475
>&2 echo " ! ${name} : Version pinned. Skipping."
@@ -474,7 +481,7 @@ bump() {
474
481
newver=" $( check_update " ${name} " " ${ourvern} " " ${urlver} " " ${desc} " \
475
482
" ${tag} " \
476
483
" ${hasfile} " \
477
- " ${ref_url} " " ${ref_expr} " " ${ref_mask} " ) "
484
+ " ${ref_url} " " ${ref_expr} " " ${ref_mask} " " ${curlopt} " ) "
478
485
if [ -n " ${newver} " ]; then
479
486
>&2 echo " ! ${name} : New version found: |${newver} |"
480
487
@@ -486,7 +493,7 @@ bump() {
486
493
487
494
urlver=" $( printf ' %s' " ${url} " | expandver " ${newver} " ) "
488
495
sigver=" $( printf ' %s' " ${sig} " | expandver " ${newver} " ) "
489
- newhash=" $( check_dl " ${name} " " ${urlver} " " ${sigver} " " ${sha} " " ${redir} " " ${keys} " ) "
496
+ newhash=" $( check_dl " ${name} " " ${urlver} " " ${sigver} " " ${sha} " " ${redir} " " ${keys} " " ${curlopt} " ) "
490
497
else
491
498
newhash=' -'
492
499
fi
@@ -586,13 +593,15 @@ live_dl() {
586
593
jp=" $( dependencies_json | jq \
587
594
" .[] | select(.name == \" ${name} \" )" ) "
588
595
589
- url=" $( printf ' %s' " ${jp} " | jq --raw-output ' .url' | expandver " ${ver} " ) "
590
- mirror=" $( printf ' %s' " ${jp} " | jq --raw-output ' .mirror' | sed ' s/^null$//' | expandver " ${ver} " ) "
591
- sigraw=" $( printf ' %s' " ${jp} " | jq --raw-output ' .sig' | sed ' s/^null$//' | expandver " ${ver} " ) "
592
- redir=" $( printf ' %s' " ${jp} " | jq --raw-output ' .redir' ) "
593
- keys=" $( printf ' %s' " ${jp} " | jq --raw-output ' .keys' | sed ' s/^null$//' ) "
596
+ url=" $( printf ' %s' " ${jp} " | jq --raw-output ' .url' | expandver " ${ver} " ) "
597
+ mirror=" $( printf ' %s' " ${jp} " | jq --raw-output ' .mirror' | sed ' s/^null$//' | expandver " ${ver} " ) "
598
+ sigraw=" $( printf ' %s' " ${jp} " | jq --raw-output ' .sig' | sed ' s/^null$//' | expandver " ${ver} " ) "
599
+ redir=" $( printf ' %s' " ${jp} " | jq --raw-output ' .redir' ) "
600
+ keys=" $( printf ' %s' " ${jp} " | jq --raw-output ' .keys' | sed ' s/^null$//' ) "
601
+ curlopt=" $( printf ' %s' " ${jp} " | jq --raw-output ' .curlopt' | sed ' s/^null$//' ) "
594
602
595
603
options=()
604
+ [ -n " ${curlopt} " ] && options+=(" ${curlopt} " )
596
605
[ " ${redir} " = ' redir' ] && options+=(--location --proto-redir ' =https' )
597
606
options+=(--output pkg.bin " ${url} " )
598
607
sig=" ${sigraw} "
0 commit comments