Bugzilla – Attachment 57055 Details for
Bug 17532
koha-shell -c does not propagate the error code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17532: Make koha-shell -c propagate the error code
Bug-17532-Make-koha-shell--c-propagate-the-error-c.patch (text/plain), 1.33 KB, created by
Jonathan Druart
on 2016-11-01 16:23:07 UTC
(
hide
)
Description:
Bug 17532: Make koha-shell -c propagate the error code
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-01 16:23:07 UTC
Size:
1.33 KB
patch
obsolete
>From a6a91af233681a42a3ef9db5eb6f1f5fa52ec22c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 1 Nov 2016 15:19:35 +0000 >Subject: [PATCH] Bug 17532: Make koha-shell -c propagate the error code > >When you execute a command using koha-shell -c, you would like to get >the error code of the command you executed. >It seems that koha-shell does not do that. >--- > debian/scripts/koha-shell | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/debian/scripts/koha-shell b/debian/scripts/koha-shell >index b8d92f5..942f024 100755 >--- a/debian/scripts/koha-shell >+++ b/debian/scripts/koha-shell >@@ -53,14 +53,16 @@ push @su_args, > . ( $opts{command} ? " -c '$opts{command}'" : '' ); > > print "Command: '".join("' '",@su_args)."'\n" if $opts{verbose}; >-system("@su_args"); >-if ( $? == -1 ) { >- print STDERR "failed to execute: $!\n"; >+my $r = system("@su_args"); >+if ( $r == -1 ) { >+ die "failed to execute: $!\n"; > } >-elsif ( $? & 127 ) { >- printf STDERR "child died with signal %d, %s coredump\n", >- ( $? & 127 ), ( $? & 128 ) ? 'with' : 'without'; >+elsif ( $r & 127 ) { >+ die "child died with signal %d, %s coredump\n", >+ ( $r & 127 ), ( $r & 128 ) ? 'with' : 'without'; > } >+exit(0) if $r == 0; >+exit(1); > > sub show_help { > my ( $err, $msg ) = @_; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17532
:
57055
|
98808
|
99918
|
99943