dependencies.sh: improve the missing perl modules detection
PATCH v2 1/1 dependencies.sh: improve the missing perl modules detection
---
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 | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
support/dependencies/dependencies.sh +25 -5
@@ -236,10 +236,30 @@ 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: +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
2.4.9
PATCH v2 1/1 dependencies.sh: improve the missing perl modules detection
Hi Vincent,
Quoted 19 lines · Vicente Olivert Riera
Signed-off-by Vicente Olivert Riera <[email protected]>---
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 | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)support/dependencies/dependencies.sh +0
-1@@ -236,10 +236,30 @@ if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then fi fi -# Check that the Perl installation is complete enough to build
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 244
Quoted 10 lines
support/dependencies/dependencies.sh +6
-4-# 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:
The original comment implied that Data::Dumper is a dependency of host-autoconf. I guess the same is true for Thread:Queue. This is useful information that IMO should be preserved. Maybe some thing like the following:
# Verify that some Perl modules that host-autoconf requires are installed.
Quoted 11 lines
support/dependencies/dependencies.sh +11
-0+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 +
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 265
Quoted 10 lines
support/dependencies/dependencies.sh +8
-0+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
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -PATCH v2 1/1 dependencies.sh: improve the missing perl modules detection
Hello,
Quoted 6 lines · Baruch Siach
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 244
Quoted 2 lines
support/dependencies/dependencies.sh +2
-0+# Check that the Perl installation is complete enough for Buildroot. +# Here is the space-separated list of the required modules:The original comment implied that
Data::Dumperis a dependency of host-autoconf. I guess the same is true for Thread:Queue. This is useful information that IMO should be preserved. Maybe some thing like the following:
Actually, the Thread::Queue module seems to be used by automake, not autoconf. It's actually what I guessed from the bug report. And it seems to indeed be the case:
thomas at skate:~/projets/buildroot (master)$ grep -r Queue output/build/host-autoconf-2.69/* output/build/host-autoconf-2.69/lib/Autom4te/Channels.pm: # Redirect all channels to push messages on a Thread::Queue using output/build/host-autoconf-2.69/lib/Autom4te/Channels.pm: # Output a message pending in a Thread::Queue. thomas at skate:~/projets/buildroot (master)$ grep -r Queue output/build/host-automake-1.15/*
output/build/host-automake-1.15/bin/automake.in: require Thread::Queue;
output/build/host-automake-1.15/bin/automake.in: import Thread::Queue;
output/build/host-automake-1.15/bin/automake.in:# Queue to push require_conf_file requirements to. output/build/host-automake-1.15/bin/automake.in: my $file_queue = Thread::Queue->new;
output/build/host-automake-1.15/bin/automake.in: $msg_queues{$file} = Thread::Queue->new;
output/build/host-automake-1.15/bin/automake.in: # Queue all makefiles. output/build/host-automake-1.15/lib/Automake/Channels.pm: # Redirect all channels to push messages on a Thread::Queue using output/build/host-automake-1.15/lib/Automake/Channels.pm: # Output a message pending in a Thread::Queue.
output/build/host-automake-1.15/old/ChangeLog.09: Cope with absent Perl modules threads and Thread::Queue.
output/build/host-automake-1.15/old/ChangeLog.09: Thread::Queue.
output/build/host-automake-1.15/old/ChangeLog.09: Thread::Queue, and output messages from such a queue, suitably
output/build/host-automake-1.15/old/ChangeLog.09: to set a Thread::Queue for channels, and to flush a queue.
output/build/host-automake-1.15/old/ChangeLog.09: threading, then use threads' and Thread::Queue'.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com