FreeBSD Bugzilla – Attachment 201777 Details for
Bug 235538
freebsd-update: Try to avoid failing when network is unavailable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add fetch_check_connection function to freebsd-update
check_conn1.patch (text/plain), 2.22 KB, created by
Ricardo Fraile
on 2019-02-05 18:52:12 UTC
(
hide
)
Description:
Add fetch_check_connection function to freebsd-update
Filename:
MIME Type:
Creator:
Ricardo Fraile
Created:
2019-02-05 18:52:12 UTC
Size:
2.22 KB
patch
obsolete
>--- freebsd-update.sh 2019-02-03 20:33:24.000000000 +0100 >+++ freebsd-update.sh_modified 2019-02-05 12:03:20.000000000 +0100 >@@ -969,6 +969,19 @@ > # > # We ignore the Port field, since we are always going to use port 80. > >+# Check connectivity to the server and loop until it works. On >+# non-interactive shell, run once only to avoid getting stuck. >+fetch_check_connection () { >+ while ! fetch ${QUIETFLAG} -o /dev/null \ >+ http://${SERVERNAME}/${FETCHDIR}/latest.ssl 2>${QUIETREDIR}; do >+ echo -n "failed. Waiting 60 seconds to retry... " >+ sleep 60 >+ if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then >+ break >+ fi >+ done >+} >+ > # Fetch the mirror list, but do not pick a mirror yet. Returns 1 if > # no mirrors are available for any reason. > fetch_pick_server_init () { >@@ -1350,6 +1363,7 @@ > # Attempt to fetch metadata patches > echo -n "Fetching `wc -l < patchlist | tr -d ' '` " > echo ${NDEBUG} "metadata patches.${DDSTATS}" >+ fetch_check_connection > tr '|' '-' < patchlist | > lam -s "${FETCHDIR}/tp/" - -s ".gz" | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ >@@ -1402,6 +1416,7 @@ > if [ -s filelist ]; then > echo -n "Fetching `wc -l < filelist | tr -d ' '` " > echo ${NDEBUG} "metadata files... " >+ fetch_check_connection > lam -s "${FETCHDIR}/m/" - -s ".gz" < filelist | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > 2>${QUIETREDIR} >@@ -1790,6 +1805,7 @@ > done < files.wanted > filelist > > # Actually fetch them >+ fetch_check_connection > lam -s "${OLDFETCHDIR}/f/" - -s ".gz" < filelist | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > 2>${QUIETREDIR} >@@ -1889,6 +1905,7 @@ > if [ -s patchlist ]; then > echo -n "Fetching `wc -l < patchlist | tr -d ' '` " > echo ${NDEBUG} "patches.${DDSTATS}" >+ fetch_check_connection > tr '|' '-' < patchlist | > lam -s "${PATCHDIR}/" - | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ >@@ -1923,6 +1940,7 @@ > if [ -s filelist ]; then > echo -n "Fetching `wc -l < filelist | tr -d ' '` " > echo ${NDEBUG} "files... " >+ fetch_check_connection > lam -s "${FETCHDIR}/f/" - -s ".gz" < filelist | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > 2>${STATSREDIR} | fetch_progress
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235538
: 201777