Skip to contentSkip to conversation

dependencies.sh: improve the missing perl modules detection

PATCH Superseded Vicente Olivert Riera 1 participant 1 message Sep 24, 2015

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 dependencies.sh: improve the missing perl modules detection

---
Changes v2 -> v3:
- Add comments about why each module is needed. (Suggested by Baruch Siach)

Changes v1 -> v2:
- Check first for perl itself, and then the modules. Also keep the comment which says that perl is needed to build host-autoconf. (Suggested by Baruch Siach)

 support/dependencies/dependencies.sh |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)
support/dependencies/dependencies.sh +27 -5
index 01ad828..0d1e303 100755
@@ -236,10 +236,32 @@ if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then
 	fi
 fi
 
-# Check that the Perl installation is complete enough to build
-# host-autoconf.
-if ! perl  -e "require Data::Dumper" > /dev/null 2>&1 ; then
-	echo "Your Perl installation is not complete enough, at least Data::Dumper is missing."
-	echo "On Debian/Ubuntu distributions, install the 'perl' package."
+# Verify that Perl is installed. Is needed to buid host-autoconf among
+# many other packages.
+check_prog_host "perl"
+
+# Check that the Perl installation is complete enough for Buildroot.
+# Here is the space-separated list of the required modules.
+# Data::Dumper (needed to build host-autoconf)
+# Thread::Queue (needed to autoreconf libevent)
+required_perl_modules="Data::Dumper Thread:Queue"
+
+# This variable will keep the modules that are missing in your system.
+missing_perl_modules=""
+
+for pm in $required_perl_modules ; do
+	if ! perl  -e "require $pm" > /dev/null 2>&1 ; then
+		missing_perl_modules="$missing_perl_modules $pm"
+	fi
+done
+
+if [ -n "$missing_perl_modules" ] ; then
+	echo "Your Perl installation is not complete enough; at least the following"
+	echo "modules are missing:"
+	echo ""
+	for pm in $missing_perl_modules ; do
+		echo -e "\t $pm"
+	done
+	echo ""
 	exit 1
 fi
Signature · 1 line
1.7.1