summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2017-01-24 10:14:15 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2017-01-24 10:14:15 +0000
commit8b85ece55d580edd744e451b375cb730b3d0ecdb (patch)
tree9549c240347e00b0a610d2880a6dad1d167419ef
parent19a4090f69e659425d32dc7a4a3ef5e3b86dd91c (diff)
ftplist.cgi provides the http server from previous installs as the
first line of its output. In contrast to the rest of the list of mirror servers, this first line does not have any location info. Only use this first line as default answer, if it has no location info. OK krw@
-rw-r--r--distrib/miniroot/install.sub10
1 files changed, 5 insertions, 5 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 794153f4b88..96ce2e8352a 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.957 2017/01/24 10:06:21 rpe Exp $
+# $OpenBSD: install.sub,v 1.958 2017/01/24 10:14:14 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -69,7 +69,7 @@ usage() {
# Wait for the ftp process to finish, or be killed after the timeout and
# extract various informations from the ftplist.cgi output.
waitcgiinfo() {
- local _l _key _val
+ local _l _s _key _val
# Wait for the ftp(1) process started in startcgiinfo() to end and
# ensure, there is actual data to extract info from.
@@ -81,9 +81,9 @@ waitcgiinfo() {
$CGI_INFO >$HTTP_LIST 2>/dev/null
# Extract the previously selected mirror server (first entry in the
- # ftplist.cgi output).
- read -r -- _l <$HTTP_LIST
- : ${HTTP_SERVER:=${_l%%/*}}
+ # ftplist.cgi output, if that has no location info).
+ read -r -- _s _l <$HTTP_LIST
+ [[ -z $_l ]] && : ${HTTP_SERVER:=${_s%%/*}}
# Extract the previously used install method, timezone information
# and a reference timestamp.