[Buildroot] [git commit] support/dependencies/dependencies.sh: correct check for open perl module

Peter Korsgaard peter at korsgaard.com
Tue Feb 7 11:35:46 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=b63e155e5fb7104e6660aa0570befa9498259cd7
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Commit 4cdd99190e89 (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 at korsgaard.com>
---
 support/dependencies/dependencies.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index 353817f8fb..88eabe921d 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -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"



More information about the buildroot mailing list