dependencies.sh: improve the missing perl modules detection
PATCH 1/1 dependencies.sh: improve the missing perl modules detection
--- support/dependencies/dependencies.sh | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-)
support/dependencies/dependencies.sh +21 -5
@@ -236,10 +236,26 @@ 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." +# 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
1.7.1
PATCH 1/1 dependencies.sh: improve the missing perl modules detection
Hi Vincent,
Quoted 10 lines · Vicente Olivert Riera
Signed-off-by Vicente Olivert Riera <[email protected]>--- support/dependencies/dependencies.sh | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-)support/dependencies/dependencies.sh +0
-0
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 240
Quoted 5 lines
support/dependencies/dependencies.sh +0
-2@@ -236,10 +236,26 @@ 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.
The information that we need perl for host-autoconf should be preserved, I think.
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 243
Quoted 3 lines
support/dependencies/dependencies.sh +0
-3-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."
You are also removing this bit of valuable information.
Maybe we should split this into two checks, one for perl itself, and then for some required modules. That would allow us to give the user a more precise diagnosis.
Quoted 13 lines
support/dependencies/dependencies.sh +13
-0+# 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 +
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 261
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 1/1 dependencies.sh: improve the missing perl modules detection
Dear Baruch Siach,
Quoted 28 lines · Baruch Siach
Hi Vincent,
Quoted 10 lines · Vicente Olivert Riera
Signed-off-by Vicente Olivert Riera <[email protected]>--- support/dependencies/dependencies.sh | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-)support/dependencies/dependencies.sh +0
-0support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 240
Quoted 5 lines
support/dependencies/dependencies.sh +0
-2@@ -236,10 +236,26 @@ 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.The information that we need perl for host-autoconf should be preserved, I think.
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 243
Quoted 3 lines
support/dependencies/dependencies.sh +0
-3-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."You are also removing this bit of valuable information.
Quoted 3 lines
Maybe we should split this into two checks, one for perl itself, and then for some required modules. That would allow us to give the user a more precise diagnosis.
I really thought about that before removing the advice about which package provides that missing perl module. But then I thought about it twice and I believe is not really so valuable. I think every Linux user should be able to know which package of the distribution that he is using provides those missing perl modules. We just say the missing modules and is up to the user to install the packages which provide those modules. Is not so hard, in my opinion. Also, in some distros the package has one name, and in other distros has a different name. We can't put all of them so having only the ones for Debian/Ubuntu only help part of the users, and not the other.
For me the patch is good as is. If other developers think the same as you, I really don't have any problem that someone else overtake this patch and make the desired modifications. Absolutely no problem at all :-)
Regards,
Vincent.
Quoted 27 lines
Quoted 14 lines
support/dependencies/dependencies.sh +13
-0+# 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 +support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 261
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 fibaruch
PATCH 1/1 dependencies.sh: improve the missing perl modules detection
Dear Baruch Siach,
I missed some things from your reply. Let me add more comments, please.
Quoted 27 lines · Vicente Olivert Riera
Dear Baruch Siach,
Quoted 24 lines · Baruch Siach
Hi Vincent,
Quoted 15 lines · Vicente Olivert Riera
Signed-off-by Vicente Olivert Riera <[email protected]>--- support/dependencies/dependencies.sh | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-)support/dependencies/dependencies.sh +0
-0@@ -236,10 +236,26 @@ if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y$BR2_CONFIG ; then
fi
fisupport/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 240
Quoted 2 lines
support/dependencies/dependencies.sh +0
-2-# Check that the Perl installation is complete enough to build -# host-autoconf.The information that we need perl for host-autoconf should be preserved, I
think.
This.
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines
support/dependencies/dependencies.sh +0
-2-if ! perl -e "require Data::Dumper" > /dev/null 2>&1 ; then - echo "Your Perl installation is not complete enough, at least
Data::Dumperis missing."
- echo "On Debian/Ubuntu distributions, install the 'perl' package."You are also removing this bit of valuable information.
Maybe we should split this into two checks, one for perl itself, and then for
some required modules.
And this, make sense to me.
First check for perl itself, and if it's not present, say that we need it to build host-autoconf, among other packages.
And then do the checks for required modules.
Sorry, is late and I was a bit sleepy, so a missed some parts of your reply.
I will send an v2.
Thanks for your review!
Vincent.
That would allow us to give the user a more
Quoted 54 lines
Quoted 2 lines
precise
diagnosis.I really thought about that before removing the advice about which package provides that missing perl module. But then I thought about it twice and I believe is not really so valuable. I think every Linux user should be able to know which package of the distribution that he is using provides those missing perl modules. We just say the missing modules and is up to the user to install the packages which provide those modules. Is not so hard, in my opinion. Also, in some distros the package has one name, and in other distros has a different name. We can't put all of them so having only the ones for Debian/Ubuntu only help part of the users, and not the other.
For me the patch is good as is. If other developers think the same as you, I really don't have any problem that someone else overtake this patch and make the desired modifications. Absolutely no problem at all :-)
Regards,
Vincent.
Quoted 19 lines
Quoted 19 lines
support/dependencies/dependencies.sh +15
-0+# 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 leastthe following"
support/dependencies/dependencies.sh +2
-0+ echo "modules are missing:" + echo ""Quoted 9 lines
support/dependencies/dependencies.sh if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then · line 261
Quoted 6 lines
support/dependencies/dependencies.sh +4
-0+ for pm in $missing_perl_modules ; do + echo -e "\t $pm" + done + echo "" exit 1 fibaruch
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot