浏览代码

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

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@korsgaard.com>
(cherry picked from commit b63e155e5fb7104e6660aa0570befa9498259cd7)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Korsgaard 2 年之前
父节点
当前提交
00cbf0095c
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      support/dependencies/dependencies.sh

+ 7 - 4
support/dependencies/dependencies.sh

@@ -280,10 +280,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"
@@ -300,6 +296,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"