From fcfbd73951f65915b183922fd2757bde0562ae53 Mon Sep 17 00:00:00 2001 From: Ciprian Badescu Date: Mon, 2 Dec 2019 15:41:21 +0200 Subject: [PATCH] (MODULES-10067) enhance perl download check --- tasks/install_shell.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/install_shell.sh b/tasks/install_shell.sh index d809d4bd8..66b81e1eb 100644 --- a/tasks/install_shell.sh +++ b/tasks/install_shell.sh @@ -35,6 +35,16 @@ exists() { fi } +# Check whether perl and LWP::Simple module are installed +exists_perl() { + if perl -e 'use LWP::Simple;' >/dev/null 2>&1 + then + return 0 + else + return 1 + fi +} + # Get command line arguments if [ -n "$PT_version" ]; then version=$PT_version @@ -341,10 +351,11 @@ do_download() { do_fetch $1 $2 && return 0 fi - if exists perl; then + if exists_perl; then do_perl $1 $2 && return 0 fi + critical "Cannot download package as none of wget/curl/fetch/perl-LWP-Simple is found" unable_to_retrieve_package }