Koha-clms/debian
Jonathan Druart 5d22e0b3a3 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>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
2020-04-01 21:11:15 +00:00
..
docs
…
scripts Bug 17532: Make koha-shell propagate the error code 2020-04-01 21:11:15 +00:00
source
…
templates Bug 22220: Fix bib Apache rewrite rule for intranet 2020-01-31 23:23:12 +00:00
README.build
…
bd-to-depends
…
build-git-snapshot
…
changelog
…
compat
…
control Bug 13193: (follow-up) Update debian/control file 2020-03-05 23:50:10 +00:00
control.in
…
copyright
…
koha-common.README.Debian
…
koha-common.bash-completion
…
koha-common.config
…
koha-common.cron.d
…
koha-common.cron.daily
…
koha-common.cron.hourly
…
koha-common.cron.monthly
…
koha-common.default
…
koha-common.dirs
…
koha-common.docs
…
koha-common.init
…
koha-common.install
…
koha-common.links
…
koha-common.logrotate
…
koha-common.postinst
…
koha-common.preinst
…
koha-common.templates
…
koha-post-install-setup
…
koha.README.Debian
…
koha.apache-ports
…
koha.config
…
koha.dirs
…
koha.install
…
koha.postinst
…
koha.postrm
…
koha.prerm
…
list-deps
…
rules
…
unavailable.html
…
update-control
…

README.build

In order to build .deb packages, following debian packages need to be present
(installed): 
devscripts
pbuilder
dh-make
fakeroot

As root (or sudo) execute:
pbuilder create

Executing build-git-snapshot without any arguments will leave package and the
rest in some pbuilder dir, eg. /var/cache/pbuilder/result It is highly
recommended that --buildresult option is used.