From 33c9c564cfdafd9af6207e3bfa41022cd6c51337 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 22 Jul 2023 15:21:37 +0200 Subject: [PATCH] libnetwork.lib.in,pck-update.in: disable repository reachability check and dependency on the 'host' tool --- autospec.spec.in | 4 ---- lib/libnetwork.lib.in | 19 ------------------- plugins/pck-update.in | 8 +------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/autospec.spec.in b/autospec.spec.in index 3b357fd..990f4cd 100644 --- a/autospec.spec.in +++ b/autospec.spec.in @@ -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 diff --git a/lib/libnetwork.lib.in b/lib/libnetwork.lib.in index d0ce58d..a2958e0 100644 --- a/lib/libnetwork.lib.in +++ b/lib/libnetwork.lib.in @@ -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 diff --git a/plugins/pck-update.in b/plugins/pck-update.in index d6f3114..ae24691 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -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