summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Fredric <kentfredric@gmail.com>2012-02-16 12:55:27 +1300
committerKent Fredric <kentfredric@gmail.com>2012-02-16 12:55:27 +1300
commit2e92212e93e218cc6a449a744941fe0f3c798831 (patch)
treea4e5260b42796355dd6f8dfbdd225745c2532e8a
parentAdded a few features to perl-module eclass SRC_TEST: SRC_TEST="network" and S... (diff)
downloadperl-overlay-2e92212e93e218cc6a449a744941fe0f3c798831.tar.gz
perl-overlay-2e92212e93e218cc6a449a744941fe0f3c798831.tar.bz2
perl-overlay-2e92212e93e218cc6a449a744941fe0f3c798831.zip
[eclass] Add a completely untested diagnostics routine to perl-module.eclass
-rw-r--r--eclass/perl-module.eclass40
1 files changed, 40 insertions, 0 deletions
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 4065e76c8..78c1765e9 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -75,6 +75,46 @@ PREFER_BUILDPL="yes"
pm_echovar=""
perlinfo_done=false
+perl_diagfile() {
+ echo "${T}/perl-diagnostics.log"
+}
+
+perl_diagnostics() {
+ local d;
+ d=$( perl_diagfile );
+ echo "perl: $(which perl)" > $d;
+ echo >> $d;
+ if [[ -x $(which grep) && -x $(which env)]]; then
+ echo "interesting ENV values:" >> $d;
+ env | grep "^\(PERL\|HOME=\|MANPATH\|PATH\|TEST\|GENTOO_PERL\)" \
+ >> $d;
+ echo >> $d;
+ fi
+ if [[ -x $(which perl) ]]; then
+ echo "perl -V : " >> $d;
+ echo >> $d;
+ perl -V 2>&1 >> $d
+ echo >> $d
+ if [[ -x $(which perl-info) ]]; then
+ echo "perl-info output: " >> $d;
+ echo >> $d;
+ perl-info >> $d;
+ echo >> $d;
+ fi
+ echo "Corelist Versions: " >> $d;
+ echo >> $d;
+ perl -MModule::CoreList -e 'for $mod ( Module::CoreList->find_modules(qr/^/) ) {
+ eval "require $mod; print q[$mod : ] . \$${mod}::VERSION . qq[\n]; 1" or print qq{\e[31mNA: $mod\e[0m\n};
+ }' >> $d;
+ fi
+}
+
+perl_fatal_error() {
+ debug-print-function $FUNCNAME "$@"
+ perl_diagnostics();
+ eerror "Please attach the contents of $(perl_diagfile) with your bug report";
+ die "$@"
+}
perl-module_src_unpack() {
debug-print-function $FUNCNAME "$@"
base_src_unpack