[libapp-stacktrace-perl] 04/05: Insist on usable gdb a bit harder

Axel Beckert abe at deuxchevaux.org
Fri Dec 12 15:39:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to annotated tag v0.03
in repository libapp-stacktrace-perl.

commit ef026e0f8b4e562a61d88a43c9f126350a90ef37
Author: Josh ben Jore <jjore at cpan.org>
Date:   Thu Jun 16 19:18:16 2011 -0700

    Insist on usable gdb a bit harder
---
 Makefile.PL | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Makefile.PL b/Makefile.PL
index 667bc30..09b3550 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,7 +1,7 @@
 use 5.010_000;
 use ExtUtils::MakeMaker;
 
-if (! `which gdb`) {
+if (! usable_gdb()) {
     print "App::Stacktrace requires gdb. Aborting installation";
     exit 0;
 }
@@ -18,3 +18,18 @@ WriteMakefile(
   NAME => 'App::Stacktrace',
   VERSION_FROM => 'lib/App/Stacktrace.pm',
 );
+
+sub usable_gdb {
+    require File::Temp;
+    my $fh = File::Temp->new();
+
+    print { $fh } <<SCRIPT;
+run -e 1
+quit
+SCRIPT
+    $fh->flush;
+    $fh->sync;
+
+    my $fn = $fh->filename;
+    return 0 == system "gdb -quiet -batch -nx -x $fn $^X >/dev/null 2>&1 </dev/null";
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libapp-stacktrace-perl.git



More information about the Pkg-perl-cvs-commits mailing list