support/dependencies/dependencies.sh: correct check for open perl module

Commit 4cdd99190e (support/dependencies/dependencies.sh: require open perl
package for libxcrypt) added a check for the "open" perl module for
libxcrypt, but it does not work as "open" cannot be directly used with
"require" as an argument is needed:

perl -e "require open"
Not enough arguments for open at -e line 1, at EOF
Execution of -e aborted due to compilation errors.

So special case the check to instead check with "use open ':std'".

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Peter Korsgaard 2023-02-07 12:32:00 +01:00
parent 8a9da9a8ca
commit b63e155e5f

View File

@ -271,10 +271,6 @@ required_perl_modules="$required_perl_modules ExtUtils::MakeMaker" # Used by hos
required_perl_modules="$required_perl_modules Thread::Queue" # Used by host-automake
required_perl_modules="$required_perl_modules FindBin" # Used by (host-)libopenssl
if grep -q ^BR2_PACKAGE_LIBXCRYPT=y $BR2_CONFIG ; then
required_perl_modules="$required_perl_modules open"
fi
if grep -q ^BR2_PACKAGE_MPV=y $BR2_CONFIG ; then
required_perl_modules="$required_perl_modules Math::BigInt"
required_perl_modules="$required_perl_modules Math::BigRat"
@ -291,6 +287,13 @@ fi
# This variable will keep the modules that are missing in your system.
missing_perl_modules=""
if grep -q ^BR2_PACKAGE_LIBXCRYPT=y $BR2_CONFIG ; then
# open cannot be used with require
if ! perl -e "use open ':std'" > /dev/null 2>&1 ; then
missing_perl_modules="$missing_perl_modules open"
fi
fi
for pm in $required_perl_modules ; do
if ! perl -e "require $pm" > /dev/null 2>&1 ; then
missing_perl_modules="$missing_perl_modules $pm"