Koha/debian/scripts
Jonathan Druart ab94a12ee4
Bug 17532: Make koha-shell propagate the error code
Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same error code
as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested it with
  $ sudo debian/scripts/koha-shell kohadev -c 'exit 8'
  $ echo $?
  8
The unpatched version returns 0 (forgets about the error code).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-03 09:15:57 +00:00
..
koha-create Bug 19465: Add --elasticsearch-server option to koha-create 2019-12-23 11:26:01 +00:00
koha-create-dirs
koha-disable
koha-dump Bug 23346: Add without-db-name parameter to koha-dump 2019-10-21 10:02:58 +01:00
koha-dump-defaults
koha-elasticsearch Bug 21872: Fix name of rebuild_elasticsearch.pl 2019-05-10 12:31:50 +00:00
koha-email-disable
koha-email-enable
koha-enable
koha-foreach
koha-functions.sh Bug 24340: allow koha-sip --disable inst 2020-02-12 16:09:35 +00:00
koha-indexer Bug 23400: Add --status to koha-indexer 2019-10-08 14:33:27 +01:00
koha-list Bug 13937: Add support for Z39.50 responder to the Debian scripts 2019-10-08 14:40:07 +01:00
koha-mysql
koha-mysqlcheck
koha-passwd
koha-plack Bug 23700: Fix output of koha-plack --restart 2019-10-21 09:46:40 +01:00
koha-rebuild-zebra
koha-remove Bug 22128: Removed outdated comment 2019-06-28 14:28:37 +01:00
koha-reset-passwd
koha-restore
koha-run-backups
koha-shell Bug 17532: Make koha-shell propagate the error code 2020-03-03 09:15:57 +00:00
koha-sip Bug 24340: allow koha-sip --disable inst 2020-02-12 16:09:35 +00:00
koha-sitemap
koha-translate
koha-upgrade-schema
koha-upgrade-to-3.4
koha-z3950-responder Bug 13937: Add support for Z39.50 responder to the Debian scripts 2019-10-08 14:40:07 +01:00
koha-zebra