libnetwork.lib.in,pck-update.in: disable repository reachability check and dependency on the 'host' tool
This commit is contained in:
parent
0e6a1e8929
commit
33c9c564cf
@ -20,10 +20,6 @@ Requires(pre): rpm
|
||||
Requires: cpio, coreutils, curl, findutils, grep, sed
|
||||
Requires: /bin/mktemp
|
||||
Requires: /usr/bin/getopt
|
||||
%if "%{stage1}" != "1"
|
||||
# host (and 'bind-utils') is not available in early stage platform development
|
||||
Requires: /usr/bin/host
|
||||
%endif
|
||||
Requires: bzip2
|
||||
Requires: gzip
|
||||
Requires: unzip
|
||||
|
@ -23,29 +23,10 @@ libnetwork.lib: "$"library not found"": @libdir@/libtranslate.lib" 1>&2
|
||||
notify.debug $"loading"": \`libnetwork.lib'..."
|
||||
|
||||
# check if all the needed tools are available
|
||||
# note: 'host' has been removed from this list because the package
|
||||
# bind-utils is not available in early stage platform development
|
||||
for tool in curl mktemp; do
|
||||
[ "$(type -p curl)" ] || notify.error $"utility not found"": \`curl'"
|
||||
done
|
||||
|
||||
# function repository.is_reachable()
|
||||
# check if the server '$1' is reachable (test = DNS lookup query)
|
||||
# args:
|
||||
# $1 : server name
|
||||
function repository.is_reachable() {
|
||||
local ftpserver="${1/[a-z]*\:\/\//}"
|
||||
[ "$ftpserver" ] || notify.error $"\
|
||||
(bug)"" -- $FUNCNAME: "$"missing mandatory arg"" (#1)"
|
||||
|
||||
if [ "$(type -p host)" ]; then
|
||||
host -W3 $ftpserver >&/dev/null
|
||||
else
|
||||
notify.warning $"utility not found"": \`host'"
|
||||
fi
|
||||
return $?
|
||||
}
|
||||
|
||||
# function repository.get_srpm_pckname_from_site()
|
||||
# get the list of SRPM packages by looking at the curl dump of the
|
||||
# ftp or html site
|
||||
|
@ -2714,13 +2714,7 @@ ftp_server_upload_num = \"$ftp_server_upload_num\" (was unset)"
|
||||
notify.debug "\
|
||||
ftp_server_upload_num = \"$ftp_server_upload_num\""
|
||||
|
||||
if [ "${ftp_rw_server[$ftp_server_upload_num]}" ]; then
|
||||
repository.is_reachable "${ftp_rw_server[$ftp_server_upload_num]}"
|
||||
# NOTE. notify.error --> notify.warning because host command fails
|
||||
# in qemu-arm environment (1.4.18)
|
||||
[ $? -eq 0 ] || notify.warning $"\
|
||||
server unreachable"": \`${ftp_rw_server[$ftp_server_upload_num]}'"
|
||||
else
|
||||
if [ ! "${ftp_rw_server[$ftp_server_upload_num]}" ]; then
|
||||
notify.error $"\
|
||||
you have no read write access to url#$ftp_server_upload_num"
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user