Bug#797904: [debhelper-devel] Bug#797904: Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-07 Thread Peter Pentchev
On Sun, Sep 06, 2015 at 11:36:00AM +0200, Niels Thykier wrote: > On 2015-09-06 11:19, Jakub Wilk wrote: > >> my $signal = $? & 0xff; > > > > This is almost right. :) You need only 7 bits to get the signal number. > > The eighth bit is on iff core was dumped: > > > > $ ulimit -c unlimited > > $

Bug#797904: [debhelper-devel] Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-07 Thread Peter Pentchev
On Mon, Sep 07, 2015 at 01:49:52PM +0200, Jakub Wilk wrote: > Hi Peter! > > * Peter Pentchev , 2015-09-07, 14:26: > >Hm, this is a personal pet peeve, feel free to ignore it :) ...but it does > >make me cringe a little bit every time people parse the wait() status code >

Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-07 Thread Jakub Wilk
Hi Peter! * Peter Pentchev , 2015-09-07, 14:26: Hm, this is a personal pet peeve, feel free to ignore it :) ...but it does make me cringe a little bit every time people parse the wait() status code directly instead of using WIFEXITED(), WEXITCODE() and friends... In C,

Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-06 Thread Jakub Wilk
my $signal = $? & 0xff; This is almost right. :) You need only 7 bits to get the signal number. The eighth bit is on iff core was dumped: $ ulimit -c unlimited $ perl -E 'system("kill -11 \$\$"); say $? & 0xff, ", ", $? & 0x7f' 139, 11 -- Jakub Wilk

Bug#797904: [debhelper-devel] Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-06 Thread Niels Thykier
On 2015-09-06 11:19, Jakub Wilk wrote: >> my $signal = $? & 0xff; > > This is almost right. :) You need only 7 bits to get the signal number. > The eighth bit is on iff core was dumped: > > $ ulimit -c unlimited > $ perl -E 'system("kill -11 \$\$"); say $? & 0xff, ", ", $? & 0x7f' > 139, 11 >

Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling

2015-09-03 Thread Jakub Wilk
Package: debhelper Version: 9.20150811 Severity: minor debhelper manpage includes this example of how to embed #DEBHELPER# in Perl code: my $temp="set -e\nset -- @ARGV\n" . << 'EOF'; #DEBHELPER# EOF system ($temp) / 256 == 0 or die "Problem with debhelper scripts: $!";