Koha/debian/scripts
Evan Giles d9849aaa3a
Bug 34653: Make koha-foreach return the correct status code
I think the correct behavior for this script should be that koha-foreach
will return 0 (success) if all the commands it tried to run succeeded, but
1 (failure) if any of the commands failed.

To test:
1. $ koha-create --create-db test
2. $ vi test.sh
if [ $USER = 'kohadev-koha' ]; then
    echo "FAILED";
    exit 1;
else
    echo "SUCCESS";
    exit 0;
fi

3. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
4. $ echo $?
5. Note that the exit status is 0 (success)

6. Apply patch

7. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
8. $ echo $?
9. Note that the exit status is 1 (failure)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-25 10:56:40 -03:00
..
koha-create
koha-create-dirs
koha-disable
koha-dump
koha-dump-defaults
koha-elasticsearch
koha-email-disable
koha-email-enable
koha-enable
koha-es-indexer Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 10:56:40 -03:00
koha-functions.sh Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-indexer Bug 32811: Remove useless lines for indexer.log 2023-03-06 09:51:49 -03:00
koha-list Bug 33108: Teach koha-list filter elasticsearch 2023-03-20 09:39:46 -03:00
koha-mysql
koha-mysqlcheck
koha-passwd Bug 28493: Make koha-passwd display the username 2023-07-19 13:00:41 -03:00
koha-plack
koha-rebuild-zebra
koha-remove Bug 33108: Make init handle koha-es-indexer 2023-03-20 09:39:47 -03:00
koha-reset-passwd
koha-restore
koha-run-backups
koha-shell
koha-sip
koha-sitemap
koha-translate
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker Bug 32992: Move background_jobs_worker to misc/workers 2023-02-24 17:52:19 -03:00
koha-z3950-responder
koha-zebra