diff options
author | erdgeist <erdgeist@erdgeist.org> | 2006-05-17 20:42:13 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2006-05-17 20:42:13 +0000 |
commit | 24e91c5d8b649e8b9c4cb1e63378c937e54d58c2 (patch) | |
tree | 975a02285fea9d145cfeee5d8d48ed10c97fcab6 | |
parent | bb7bf169676e646b1e0f00da2157752ac37b64c9 (diff) |
Provide more clues as how to continue if fetching dir list from server fails
-rwxr-xr-x | ezjail-admin | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ezjail-admin b/ezjail-admin index 9d8b2a6..01369bb 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -154,20 +154,22 @@ ezjail_updateports () { | |||
154 | # Try to fetch the list of releases the server provides | 154 | # Try to fetch the list of releases the server provides |
155 | ezjail_queryftpserver () { | 155 | ezjail_queryftpserver () { |
156 | unset _ret | 156 | unset _ret |
157 | echo -n "Querying your ftp-server... " | ||
157 | TIFS=${IFS}; IFS= | 158 | TIFS=${IFS}; IFS= |
158 | for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do | 159 | for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do |
159 | if [ ${ezjail_path} = "NO" ]; then | 160 | if [ ${ezjail_path} = "NO" ]; then |
160 | echo "Warning: I am having problems querying the ftp server you specified (${ezjail_ftphost})." | 161 | echo "Warning: I am having problems querying the ftp server you specified (${ezjail_ftphost})." |
161 | _ret=1; break | 162 | _ret=1; break |
162 | fi | 163 | fi |
163 | ezjail_ftpresponse=`echo ls | ftp ${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/ 2> /dev/null` | 164 | ezjail_ftpresponse=`echo ls | ftp ${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/ 2> /dev/null` 2> /dev/null |
164 | if [ $? -eq 0 ]; then | 165 | if [ $? -eq 0 ]; then |
165 | echo -e "The ftp server you specified (${ezjail_ftphost}) seems to provide the following builds:\n${ezjail_ftpresponse}\n." | 166 | echo -e "The ftp server you specified (${ezjail_ftphost}) seems to provide the following builds:\n${ezjail_ftpresponse}" |
166 | _ret=0; break | 167 | _ret=0; break 2 |
167 | fi | 168 | fi |
168 | done | 169 | done |
169 | IFS=${TIFS} | 170 | IFS=${TIFS} |
170 | return _ret | 171 | ezjail_ftpserverqueried="YES" |
172 | return ${_ret} | ||
171 | } | 173 | } |
172 | 174 | ||
173 | ############################# | 175 | ############################# |
@@ -504,7 +506,7 @@ setup|update) | |||
504 | ######################## ezjail-admin INSTALL ######################## | 506 | ######################## ezjail-admin INSTALL ######################## |
505 | install) | 507 | install) |
506 | # Clean variables, prevent polution | 508 | # Clean variables, prevent polution |
507 | unset ezjail_release ezjail_ftphost ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_reldir | 509 | unset ezjail_release ezjail_ftphost ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_reldir ezjail_ftpserverqueried |
508 | 510 | ||
509 | shift; while getopts :mpsh:r: arg; do case ${arg} in | 511 | shift; while getopts :mpsh:r: arg; do case ${arg} in |
510 | m) ezjail_installmanpages=" manpages";; | 512 | m) ezjail_installmanpages=" manpages";; |
@@ -554,8 +556,9 @@ install) | |||
554 | # Try all paths as stolen from sysinstall, break on success. | 556 | # Try all paths as stolen from sysinstall, break on success. |
555 | for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do | 557 | for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do |
556 | if [ "${ezjail_path}" = "NO" ]; then | 558 | if [ "${ezjail_path}" = "NO" ]; then |
557 | echo "Could not fetch ${pkg} from ${ezjail_ftphost}. Maybe your release (${ezjail_release}) is specified incorrectly or the host ${ezjail_ftphost} does not provide that release build. Use the -r option to specify an existing release or the -h option to specify an alternative ftp server." >&2 | 559 | echo -e "\nCould not fetch ${pkg} from ${ezjail_ftphost}.\nMaybe your release (${ezjail_release}) is specified incorrectly or the host ${ezjail_ftphost} does not provide that release build.\nUse the -r option to specify an existing release or the -h option to specify an alternative ftp server." >&2 |
558 | ezjail_queryftpserver; exit 1 | 560 | [ -z "${ezjail_ftpserverqueried}" ] && ezjail_queryftpserver |
561 | exit 1 | ||
559 | fi | 562 | fi |
560 | ftp "${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/*" && break | 563 | ftp "${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/*" && break |
561 | done | 564 | done |