From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 153491381F3 for ; Wed, 11 Sep 2013 06:04:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 35A1FE0C7C; Wed, 11 Sep 2013 06:04:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 28826E0C62 for ; Wed, 11 Sep 2013 06:04:12 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9971233EC31 for ; Wed, 11 Sep 2013 06:04:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1CF65E546B for ; Wed, 11 Sep 2013 06:04:08 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1378845705.9b74257370da8926d774e6ffd380805d7a053e28.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed.pl.in X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 9b74257370da8926d774e6ffd380805d7a053e28 X-VCS-Branch: master Date: Wed, 11 Sep 2013 06:04:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: cd1b00cd-919e-408c-a651-baa90fa58bf6 X-Archives-Hash: 8bcb70fcf7c3d7bf1834d073f3881b98 commit: 9b74257370da8926d774e6ffd380805d7a053e28 Author: Sven Eden gmx net> AuthorDate: Tue Sep 10 20:41:45 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Tue Sep 10 20:41:45 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=9b742573 ufed.pl: Added a constant for easier setting on how to start the curses interface. (Useful in development) --- ufed.pl.in | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/ufed.pl.in b/ufed.pl.in index 09c0508..b7d8323 100644 --- a/ufed.pl.in +++ b/ufed.pl.in @@ -9,13 +9,17 @@ use warnings; use lib qw{XX_perldir@}; use Portage; +# 0 = normal, 1 = gdb, 2 = valgrind +use constant { EXEC => 0 }; + my $version = 'XX_PACKAGE_VERSION@'; my $interface = 'ufed-curses'; -#my $memcheck = "/usr/bin/valgrind -v --trace-children=yes --tool=memcheck" -# . " --track-origins=yes --leak-check=full --show-reachable=no" -# . " --read-var-info=yes" -# . " XX_libexecdir@/ufed-curses 2>/tmp/ufed_memcheck.log"; +my $gdb = "gdb -ex run ufed-curses"; +my $memcheck = "/usr/bin/valgrnd -v --trace-children=yes --tool=memcheck" + . " --track-origins=yes --leak-check=full --show-reachable=no" + . " --read-var-info=yes" + . " XX_libexecdir@/ufed-curses 2>/tmp/ufed_memcheck.log"; sub finalise; sub flags_dialog; @@ -60,10 +64,19 @@ sub flags_dialog { POSIX::close $iread; POSIX::dup2 $owrite, 4; POSIX::close $owrite; - exec { "XX_libexecdir@/$interface" } $interface or - do { print STDERR "Couldn't launch $interface\n"; exit 3 } -# exec $memcheck or -# do { print STDERR "Couldn't launch valgrind\n$!\n"; exit 3 } + if (0 == EXEC) { + exec { "XX_libexecdir@/$interface" } $interface or + do { print STDERR "Couldn't launch $interface\n"; exit 3 } + } elsif (1 == EXEC) { + exec $gdb or + do { print STDERR "Couldn't launch $interface\n"; exit 3 } + } elsif (2 == EXEC) { + exec $memcheck or + do { print STDERR "Couldn't launch $interface\n"; exit 3 } + } else { + print STDERR "Value " . EXEC . " unknown for EXEC\n"; + exit 4; + } } POSIX::close $iread; POSIX::close $owrite;